Summarise Rows
Totals the rows of a table by group, such as per customer and month.
@lainstack/data/summarise-rows · Data
How to use it
Section titled “How to use it”Use Summarise Rows to total a table by group. For example, add up each customer’s emissions per month and transport mode, or each importer’s weight for a report.
Good to know:
- Rows is a List of Records or a Table from an earlier step. Narrow it first with Select Rows if you only want some of the rows.
- Group by takes up to 3 columns. Each group is one row of the result, and groups come out in the order they first appear; add Select Rows after to sort them. Pick Its month on a date column to group by month, such as 2026-11; months are counted in UTC, and a date and time with no offset is read as UTC. Leave Group by empty to total every row into one row. A blank in a group column makes its own group, shown empty. Text groups ignore outer spaces and letter case, so “ACME” and “Acme” are one group, shown as first written.
- Totals takes up to 10. Sum and Average read a number column. Smallest and Largest read a number or date column. Count of rows counts every row of the group and needs no column.
- Blank values are skipped by Sum, Average, Smallest and Largest. A group with no value to read gets an empty total, so those totals can be empty even when the column is required. Sum is rounded to the column’s decimal places, or to the most decimals its values have if none are set; Average keeps two more. A value that isn’t a number or date stops the step and names the row.
- Summary is a Table with the group columns first, then one column per total. A total keeps its column’s unit, such as kg or tCO2e. A month column is named “Month of” the date column. Count is a whole number.
- Summarise Rows reads at most 20,000 rows and makes at most 5,000 groups; beyond that the step stops and says so, and nothing is cut off.
Settings
Section titled “Settings”| Setting | Key | Type | Details |
|---|---|---|---|
| Rows (required) | rows |
Value | A List of Records or a Table from an earlier step. |
| Group by | groupBy |
List | One row of the Summary for each group. Leave empty to total every row. At most 3 items. |
| Totals | totals |
List | What to work out for each group. At most 10 items. |
Outputs
Section titled “Outputs”| Output | Path | Type |
|---|---|---|
| Summary | summary |
Value |