New to Kendo UI for Angular? Start a free 30-day trial
Angular PivotGrid Aggregates
Aggregates in PivotGrid serve to combine and summarize data across different dimensions. These aggregates enable users to perform calculations such as sum, average, count, and more, providing a comprehensive overview of the data from various perspectives.
The following example demonstrates some of the built-in aggregates of the PivotGrid in action.
Change Theme
Theme
Loading ...
To aggregate the PivotGrid data, set the measures
property of the kendoPivotLocalBinding
directive to a Measure
collection.
html
<kendo-pivotgrid [measures]="measures" ... ></kendo-pivotgrid>
You can set the aggregate
property to:
- an
Aggregate
object - predefined built-in aggregates. Below is a list of supported built-in aggregates applicable for local data binding only:
sumAggregate
minAggregate
maxAggregate
averageAggregate
countAggregate
ts
import { Measure, minAggregate, sumAggregate} from '@progress/kendo-angular-pivotgrid';
public measures: Measure[] = [
{
name: 'Total',
value: (item: DataItem): number => item.Price, aggregate: sumAggregate
}, //...
];
To display specific aggregates during initialization, set the measureAxes
property to a PivotGridAxis
collection.
ts
public defaultMeasureAxes: PivotGridAxis[] = [
{ name: ['Total'] },
{ name: ['Min'] }
];