group_by

Aliases: groupby (deprecated).

group_by([grouping: col storable]*) -> grouping

Declares grouping columns and optional grouping expressions for aggregate and window stages.

Pass group_by(...) to verbs that partition aggregates or window functions, such as align, timechart, statsby, and window. Arguments may be simple column names, name: expression bindings (the expression must be storable and must not contain aggregates, window functions, or bin functions), or unpacked link columns (^Link...) whose fields expand into concrete grouping columns.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

statsby events:count(), group_by(region)

Partitions statsby output with group_by so each region gets its own count() aggregate.