Pivot totals can be inserted into the grid to display the total aggregations of rows.
Column Group Totals
When pivoting by multiple columns, the grid automatically inserts a column for each active aggregation representing that group's total. These columns are by default only displayed when the column group is closed.
The example below demonstrates that when collapsed, group totals are displayed for each sport. When expanded, these are hidden and instead display the break-down per year.
Row Totals
A total column can be included for each aggregation by using the pivotRowTotals
grid option. This option can be set to "before"
or "after"
determining the position of these total columns relative to the pivot columns.
The example above demonstrates the following configuration for adding additional pivot row totals at the start of the grid:
const gridOptions = {
pivotRowTotals: 'before',
// other grid options ...
}
When trying to update the position of row totals reactively, see Changing Data, Filters, and Configurations.
Next Up
Continue to the next section to learn about Tree Data.