All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Aggr Function

  • 2 minutes to read

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:

Aggr(summaryExpression, column1, column2, ...) 

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.

NOTE

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:

Aggr(Sum([ExtendedPrice]), GetYear([OrderDate]), [Country]) 

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:

Examples for WinForms Pivot Grid

Examples for ASP.NET Pivot Grid

Examples for Dashboards