Pivot Totals and Subtotals
Adds a grand total row, a grand total column, and optional subtotals for row groups and column groups. Totals can be placed first or last. Totals are recomputed from leaf data so non-additive functions stay correct.
Planned. This page shows the specification from issue #198. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
Rows: Region > Country. Columns: Year. Value: average Order Value. Grand total row and column are on.
Expected behavior
Total rows and columns appear or disappear as toggled. With average selected, the grand total equals the average across all leaf rows, not the average of the subtotals.
Planned API surface
pivot.totals.grandRowpivot.totals.grandColumnpivot.totals.rowSubtotalspivot.totals.columnSubtotalspivot.totals.positionpivot.totals.labelAcceptance criteria
- Grand totals equal the aggregation over the full filtered leaf set. (pending)
- Subtotals appear only for non-leaf levels. (pending)
- The position setting moves the totals without changing their values. (pending)
- Total rows are visually distinct and have a 'total' row type in the API. (pending)
- Totals respect active filters. (pending)