Skip to main content

Group and summarise

Group rows by one or more columns and compute count, sum, average, minimum, maximum, first or last per group; without group columns, one summary row.

Command in the Data Table toolkit · id ooa.datatable/aggregate · 4 inputs (2 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
TableTableYesSource table.
Group byListNoColumns to group by, e.g. ["Vendor"]; one summary row for the whole table when empty.
SummariesDictionaryYesNew column name to 'function:column', e.g. {"Total": "sum:Amount", "Invoices": "count"}. Functions: count, sum, avg, min, max, first, last, count_distinct.
Sort groupsBooleanNotrueOrder the groups by their group values; in order of first appearance when off.

Outputs​

OutputTypeWhat it is
tableTableOne row per group: the group columns, then one column per summary.
countNumberNumber of groups.