Help Centre

Aggregate Rows (Pivot)
Aggregate rows is a templated script operation which creates a new table comprising one or more category columns (dimensions) together with columns of aggregated values (aggregations). This kind of operation is also known as a pivot.
Aggregation options:
Max
Largest value
Min
Smallest value
Sum
Total of all values
Mean
Average value
StdDev
Standard deviation of values
Count
Number of numeric values
CountNonEmpty
Number of values, excluding empty values: ""
CountDistinct
Number of distinct values
First
First value in the column
Last
Last value in the column

Usage

pivot:
dimensions:
- "<insert column to pivot on>"
- "<insert column to pivot on>"
aggregations:
- resultColumn: "<insert name of aggregated column>"
sourceColumn: "<insert name of column to aggregate>"
aggregation: "<Max, Min, Sum, Mean, StdDev, Count, CountNonEmpty, CountDistinct, First, Last>"
- resultColumn: "<insert name of aggregated column>"
sourceColumn: "<insert name of column to aggregate>"
aggregation: "<Max, Min, Sum, Mean, StdDev, Count, CountNonEmpty, CountDistinct, First, Last>"

Example

pivot:
dimensions:
- "policy"
aggregations:
- resultColumn: "Total Premium"
sourceColumn: "premium"
aggregation: "Sum"
This creates a table with a policy column, and a column called ‘Total Premium’, which is populated with the sum premium of every policy.