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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Table | Table | Yes | Source table. | |
| Group by | List | No | Columns to group by, e.g. ["Vendor"]; one summary row for the whole table when empty. | |
| Summaries | Dictionary | Yes | New column name to 'function:column', e.g. {"Total": "sum:Amount", "Invoices": "count"}. Functions: count, sum, avg, min, max, first, last, count_distinct. | |
| Sort groups | Boolean | No | true | Order the groups by their group values; in order of first appearance when off. |
Outputs
| Output | Type | What it is |
|---|---|---|
| table | Table | One row per group: the group columns, then one column per summary. |
| count | Number | Number of groups. |