[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
  [Collapse]Window Calculations
    Window Calculations Overview
    Partitioning Criteria
    Creating Window Calculations
    Window Calculation Functions
 [Expand]API Reference
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Window Calculations Overview

Window calculations use window functions to perform a calculation across a set of window rows related to the current row. Partitioning Criteria are applied to rows to arrange them in windows.


Window calculations are available for the Optimized calculation engine. Use the PivotGridOptionsData.DataProcessingEngine property to enable the Optimized engine.

The following calculation types are supported:

Expanded Running Total

Allows you to calculate a cumulative total for a set of measure values.



Field Data Binding

Binding Partitioning Parameters
RunningTotalBindingBase CalculationPartitioningCriteria.ColumnValue SummmaryType = PivotSummaryType.Sum

Expanded Moving Calculation

Allows you to apply a moving calculation, which uses neighboring values to calculate a total. Note that neighboring values are specified using offsets from the currently processed value.


WindowSum(Sum([Sales]), -1, 1)

Field Data Binding

Binding Partitioning Parameters
MovingCalculationBindingBase CalculationPartitioningCriteria.ColumnValue SummmaryType = PivotSummaryType.Sum, PreviousValuesCount = 1, NextValuesCount = 1

Expanded Difference

Allows you to compute differences between measure values.


Sum([Sales]) - Lookup(Sum([Sales]), -1)

Field Data Binding

Binding Partitioning Parameters
DifferenceBindingBase CalculationPartitioningCriteria.ColumnValue Target = DifferenceTarget.Previous, DifferenceType = DifferenceType.Absolute

Expanded Percent of Total

Allows you to calculate a contribution of individual measure values to a total.


Sum([Sales]) / Total(Sum([Sales]))

Field Data Binding

Binding Partitioning Parameters
PercentOfTotalBindingBase CalculationPartitioningCriteria.ColumnValue

Expanded Rank

Allows you to rank values of the specified measure.


RankCompetition(Sum([Sales]), 'asc')

Field Data Binding

Binding Partitioning Parameters
RankBindingBase CalculationPartitioningCriteria.ColumnValue RankType = RankType.Competition Order = PivotSortOrder.Ascending

Expanded See Also

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