knoten / builtin / datatransformation
Summarize items
Totals, counts and lists per group, like a spreadsheet pivot table
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Group your items by one or more fields, then count, add up, average or list values in each group. It is the pivot table of a spreadsheet, as a step.
What it does
Section titled “What it does”Summarize items receives every item at once.
- Group by: one or more fields (dot paths such as
customer.country). Leave it empty for one summary of all items. - Summaries: one card per calculation. Each card has a Calculation, a Field and an optional Output name:
| Calculation | What it gives | Default output name |
|---|---|---|
| Count items | How many items are in the group (no field needed) | count |
| Count unique | How many different values the field has | count_unique_email |
| Sum | The total of the field | sum_price |
| Average | The mean of the field | avg_price |
| Min / Max | The smallest / largest value (ISO dates compare as dates) | min_price / max_price |
| Join as text | The values joined with a Separator (default , ) |
joined_name |
| Collect as a list | Every value, as a list | list_name |
Groups appear in the order their first item arrived. Values are compared exactly: 1 and "1" are two different groups. Values that are not numbers are skipped by Sum and Average, with one warning that names the field and the items, for example 3 values in "price" weren't numbers and were skipped (items 4, 9, 12). After a run, the step shows how many groups it made.
When to use it
Section titled “When to use it”- Sales per region, tickets per status, emails per sender.
- One total line at the end of a list (leave Group by empty).
- Before a chart or a report step, to turn many rows into a few.
Inputs and settings
Section titled “Inputs and settings”| Einstellung | Typ | Was es bewirkt |
|---|---|---|
| Group by | Tags | Leave empty for one summary of all items. |
| Summaries | List of entries | Standard: [{"op":"count"}] |
| Summaries (each entry) › Calculation | Choice | Options: Count items, Count unique, Sum, Average, Min, Max, Join as text, Collect as a list. Standard: Count items |
| Summaries (each entry) › Field | Text | Dot path, e.g. price or customer.email. Count without a field counts items. |
| Summaries (each entry) › Output name | Text | Defaults to e.g. sum_price, count, count_unique_email. |
| Summaries (each entry) › Separator | Text | |
| Output | Choice | Options: One item per group, One item with all groups. Standard: One item per group |
| Options | Group | |
| Options › Skip empty values | Toggle | Standard: On |
| Options › When a field is missing | Choice | Options: Ignore the item for that summary, Stop the step. Standard: Ignore the item for that summary |
Set Output to choose the shape:
- One item per group (default): each group is an item with its group fields and its summaries.
- One item with all groups: a single item
{ groups: [...] }, handy for one message or one row.
Under Options, Skip empty values (on by default) leaves empty values out, and When a field is missing either ignores that item for the summary or stops the step.
Because the step knows its output fields from the settings, the next step’s data picker shows them before you run anything.
Outputs
Section titled “Outputs”-
Output
[ { "region": "EU", "sum_price": 1250, "count": 12 }, { "region": "US", "sum_price": 980, "count": 9 }]Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
None.
Example workflow
Section titled “Example workflow”- HTTP Request gets the to-dos of a project, one item each.
- Filter keeps the completed ones.
- Summarize items, Group by
userId, Count items: how many each person finished.
Common issues
Section titled “Common issues”- One group per item: the Group by field is different on every item (an id or a date with time). Group by a coarser field.
- The sum is lower than expected: some values are text such as
"12,50". Check the warning in the run log, and fix the values with Edit Fields first. - A field is missing in the output: give the card a Field; only Count items works without one.
Related nodes
Section titled “Related nodes”- Aggregate: gather fields from all items into lists, without grouping.
- Remove Duplicates: keep one item per value.
- JavaScript Code: any other calculation.