[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Collapse]Cross-Platform Core Libraries
  Core Library Assemblies
 [Expand]DevExpress Data Library
 [Collapse]DevExpress Pivot Grid Core Library
   Pivot Grid Expression Syntax
   Optimized Calculation Engine
   Aggr Function
  [Expand]Window Calculations
 [Expand]API Reference
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Aggr Function

The Optimized calculation engine introduces a new aggregate function not available in Legacy and LegacyOptimzed modes - the Aggr function.

The Aggr function uses the summary function to calculate values for data obtained from the first specified data source column, group data by the next specified columns, and calculate group summaries. Aggr functions can be nested, and you can summarize aggregated data in a single expression.

The Aggr function has the following syntax:

The first argument is a summary expression calculated against a data source column, followed by a set of data columns whose values are grouped to calculate summaries for the first argument.


The Aggr function is available for the Optimized calculation engine. Use the PivotGridOptionsData.DataProcessingEngine property to enable the Optimized engine.

For example, the data below is Northwind orders for several years:

To find countries with sales by year that exceed 30000, create the SalesByYearByCountry field and calculate its value with the following expression:

Place the SalesByYearByCountry field in the Pivot Control’s Filter Header area. Click the field and apply a filter.

The following picture illustrates the resulting table:

You can find this example and other examples in our Demo Center:

Expanded Examples for WinForms Pivot Grid

Expanded Examples for ASP.NET Pivot Grid

Expanded Examples for Dashboards

Is this topic helpful?​​​​​​​