Window Calculation Functions
- 4 minutes to read
You can use the WindowExpression.Expression property to compose an expression that uses window calculation functions, as illustrated in the following code snippet:
pivotGridControl.Fields["fWindowExpr"].DataBinding = new WindowExpressionBinding() {
Expression = "RunningMax(Sum([ProductAmount]))",
PartitioningCriteria = CalculationPartitioningCriteria.ColumnValueAndRowParentValue
};
The resulting grid looks as shown below:
Documentation:
How to create Window Calculations
Describes how to create a PivotGrid field that uses a window function to calculate its data.
-
Explains how to specify a window that limits measure values used in a calculation.
The following table lists functions you can use to compose an expression for the WindowExpressionBinding data binding instance’s Expression property:
Function | Description | Example |
---|---|---|
Last() | Returns the number of rows from the current row to the last row in the window. | Last() |
First() | Returns the number of rows from the current row to the first row in the window. | First() |
Index() | Returns the index of the current row in the window. | Index() |
Size() | Returns the number of rows in the window. | Size() |
Lookup | Returns the value of the expression in a target position specified as a relative offset from the current position. | Lookup |
Rank | Returns the standard competition rank for the current row in the window. | Rank |
Rank | Returns the dense rank for the current row in the window. | Rank |
Rank | Returns the unique rank for the current row in the window. | Rank |
Rank | Returns the modified competition rank for the current row in the window. | Rank |
Rank | Returns the percentile rank for the current row in the window. | Rank |
Running | Returns the running average of the specified expression from the first row in the window to the current row. | Running |
Running | Returns the cumulative result of the custom function applied to specified expression from the first row in the window to the current row. | Running |
Running | Returns the running count of the specified expression from the first row in the window to the current row. | Running |
Running | Returns the running maximum of the specified expression from the first row in the window to the current row. | Running |
Running | Returns the running minimum of the specified expression from the first row in the window to the current row. | Running |
Running | Returns the running sum of the specified expression from the first row in the window to the current row. | Running |
Window | Returns the result of the custom function applied to the specified expression in the window. | Window |
Window | Returns the average of the expression within the window, which is defined using offsets from the current row. | Window |
Window | Returns the count of the expression within the window. | Window |
Window | Returns the distinct count of the expression within the window. | Window |
Window | Returns the maximum of the expression within the window. | Window |
Window | Returns the minimum of the expression within the window. | Window |
Window | Returns the statistical mode in the window (the element that occurs most often in the values calculated with the specified expression within the window). | Window |
Window | Returns the median of the expression within the window. | Window |
Window | Returns the sum of the expression within the window. | Window |
Window | Returns the variance of the expression within the window. | Window |
Window | Returns the biased variance of the expression within the window. | Window |
Window | Returns the sample standard deviation of the expression within the window. | Window |
Window | Returns the biased standard deviation of the expression within the window. | Window |
Total | Returns the total for the specified expression in a calculation window. | Total |