1234567891011121314151617
/* ========================================================== * Weekly active accounts * How many accounts fired at least 5 events in a week? */ function main() { return Events({ from_date: "2027-02-08", to_date: "2027-03-08" }) // bucket every account's events by the week they landed, // then count how many events each account sent .groupByUser([halyard.numeric_bucket('time', halyard.weekly_time_buckets)], halyard.reducer.count()) // drop the weeks where an account sent fewer than 5 events .filter(function(event_count) { return event_count.value >= 5; })