Aggregate
Group rows by one or more columns and compute summary values per group.
When to use this¶
- You want a total, average, or count per category, for example total quantity per product, average cost per location, or count of orders per customer
- You want to roll up a fine-grained dataset to a coarser level before feeding it downstream
What you need¶
- One upstream data source wired into the Aggregate node
- The columns to group by and the columns to summarize
Parameters¶
Set in the side panel:
| Setting | Description |
|---|---|
| Group By | One or more column names. Rows that share the same values across these columns are grouped together. |
| Aggregations | One or more column ยท function pairs. Each pair produces one output column. |
Aggregation functions¶
| Function | What it does |
|---|---|
| Sum | Total of the column's numeric values in the group |
| Average | Mean of the column's numeric values in the group |
| Count | Number of rows in the group |
| Min | Smallest numeric value in the group |
| Max | Largest numeric value in the group |
| First | Value from the first row in the group that has one. Blanks are skipped |
What you get¶
One row per group, with one column per Group By field and one column per Aggregation.
Workflow wiring¶
flowchart LR
n1["Import Data (orders.csv)"] --> n2["Aggregate (group by product, sum quantity)"]
n2 --> n3["Script"]
n3 --> n4["Create Scenario"]
Common mistakes¶
- Using Sum, Average, Min, or Max on a column that has non-numeric values. Those values drop out of the group and the total comes back quietly low. Once half a column will not read as numbers, the run says so in the Execution Report, naming the column and a few of the offending values. Below that it says nothing
- Count counts all rows in the group, including rows where the chosen column is blank
- Forgetting to add an Aggregation. Without one, every group collapses to a single Group By row with no summary columns