[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)

Optimized Calculation Engine

Starting from 19.2, the PivotGridControl can work in Optimized Mode and use the Optimized Calculation Engine. The Optimized Calculation Engine does not support legacy features and behavior but provides new functionality and improves performance.

New Functionality

To switch to Optimized mode, set the PivotGridOptionsData.DataProcessingEngine property to DataProcessingEngine.Optimized:

Expanded 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 following code snippet demonstrates how the Aggr function is used in expression data bindings:

The resulting Pivot Grid is shown below:

For more information, refer to the Aggr Function article and review the following examples:

Expanded Window Calculations

Window calculations compute a scalar value for each row based on a calculation against a subset of rows in a data table (window frame). A window frame is defined in a data table by certain criteria.

Review the following topics for more information:

Expanded Data Binding API

The key concept of the Data Binding API is the data binding source. The Data Binding API does not divide PivotGrid fields into bound and unbound. All fields have the DataBinding property. All functionality related to calculations are encapsulated into the data binding source - the DataBindingBase (see DevExpress.XtraPivotGrid.DataBindingBase) descendant that is assigned to the field's DataBinding property.

The fields previously named bound get their data from a data source column. In Optimized mode, the bound field's DataBinding property is set to the DataSourceColumnBinding instance.

Former unbound fields' DataBinding property is set to an instance of the class that specifies how the field gets its data. A field can get data from calculations (the ExpressionDataBinding class), specific window calculations (RunningTotalBinding, MovingCalculationBinding etc.), or from a window calculation specified by an expression (the WindowExpressionBinding class).

The code snippet below demonstrates how to use the Data Binding API to calculate running totals.


The complete sample project is available in the DevExpress Demo Center: Code Examples - Optimized Mode - Field Calculation Bindings module in the XtraPivotGrid MainDemo .


The Data Binding API is in effect only in Optimized Mode. Other calculation engines ignore the DataBinding (see PivotGridFieldBase.DataBinding) property.

Expanded Optimized Mode Restrictions

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