Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module provides a Views field handler that calculates the running total of a chosen field for each row in a view. This is particularly useful for chart displays or any situation where you need to see the cumulative value of a field.

This module creates a Views field handler that enables you to calculate the cumulative value of another field in your view. This is great for Views displays created by the Charts module, but can be used for any View that allows fields.

It was inspired by this comment on the Views PHP module page:

While this module allows you to directly use PHP inside views which may be useful for quick and easy solutions, it is highly advisable to use regular handlers and plugins when available (or even to create one yourself).

and this related post: 44,497 People Are Wrong: How to NEVER Need Views PHP.

Instructions

After you enable this module:

  1. Create/edit your view.
  2. Add a field that outputs numbers. This is considered the "data field" for purposes of this module.
  3. Add the "Global: Cumulative Field" field (created by this module)
  4. In cumulative field's field settings, select the field for which you want a cumulative value (the "data field") from the radios.

That's it! The "Cumulative Field" should add all the previous rows' values with the current row's value at each row.

Related Module

If you want a Views field to perform simple math expressions, try this one: https://www.drupal.org/project/views_simple_math_field

Credit

Thanks to Marton Bodonyi (codesidekick) via Database independent Views 3 custom field handlers for the majority of the code used for the 7.x branch and Danny Sipos (upchuk) via Creating a custom Views field in Drupal 8 for the code for the 8.x branch. I also received support from Elias Muluneh.

Activity

Total releases
3
First release
Jan 2025
Latest release
5 months ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Release date
2.0.5 Stable Feb 14, 2026
2.0.4 Stable Jan 8, 2026
2.0.3 Stable Jan 19, 2025