Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

views_cumulative_field

693 sites Security covered
View on drupal.org

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
2 months ago
Release cadence
196 days
Stability
100% stable

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