Skip to content

GROUP BY splits the numbers into rows, one for each value of a field.

FROM deals
SHOW count, won_value
GROUP BY owner, stage
GROUP BY [ONLY] [TOP <n>] <field> [OVERALL][, <field> ...]
Grouping Example
A field of the object GROUP BY stage, GROUP BY owner
A custom property GROUP BY customer_tier, GROUP BY "Customer tier"
A related object’s field GROUP BY accounts.industry
One specific reference GROUP BY decision_maker.title
A time unit GROUP BY month, GROUP BY day_of_week

day, week, month, quarter, year, day_of_week, hour_of_day, week_of_year, and month_of_year.

GROUP BY month lists only the months that have data. To list every month in the period, with zeros where nothing happened, use TIMESERIES.

accounts.industry follows every link between the record and accounts. To follow one specific reference instead, write the reference’s name and a dot, for example a deal’s decision maker:

FROM deals
SHOW count
GROUP BY decision_maker.title

Keep the biggest groups and fold the rest into an Other row:

FROM deals
SHOW won_value
GROUP BY TOP 5 owner
Form Result
TOP 5 owner The five biggest owners, plus Other
ONLY TOP 5 owner The five biggest owners, no Other row
TOP 5 owner OVERALL With two groupings, ranks owners across everything instead of within each value of the first grouping

Groups are ranked by the first metric you show.