Log In
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]HTML Editor
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Collapse]Data Shaping
       Running Totals
       Automatic totals
       Custom Totals
       Grand Totals
      Aggregation Levels
   [Expand]Data Analysis
   [Expand]Data Formatting
   [Expand]Data Export
   [Expand]Design-Time Features
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Running Totals

Running totals allow you to calculate cumulative values that correspond to the specified column or row fields. For example, the ASPxPivotGrid in the image below displays cumulative prices for each quarter for two years.

To enable this capability for the required column or row field, use the PivotGridFieldBase.RunningTotal property. For instance, in the ASPxPivotGrid control below, running totals are enabled for the "Quarter" field.

If the PivotGridFieldBase.RunningTotal property is set to true, cumulative values depend on the order of values. If end-users change the order by sorting, grouping or filtering, cumulative values are also changed.

To specify whether running totals are calculated independently within individual groups, or for the entire Pivot Grid, use the PivotGridOptionsData.AllowCrossGroupVariation property. In the image below, running totals for the "Quarter" are calculated independently for each year (the PivotGridOptionsData.AllowCrossGroupVariation property is set to false).

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T590001.

This example demonstrates how to include previous cell values in values of the next cell. To calculate cumulative values, set the PivotGridFieldBase.RunningTotal property of the corresponding field to true.

Expanded See Also

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