Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Facets 3.0.6 Minor update available for module facets (3.0.6). Release: Facets 3.0.5 Minor update available for module facets (3.0.5). Release: Flag 5.1.0 Minor update available for module flag (5.1.0). Release: Random Name 1.2.3 Minor update available for module random_name_chooser (1.2.3). Release: Text with summary 1.0.0 Initial release available for module text_with_summary (1.0.0)! Release: Ágora Transparency Theme 1.0.7 Minor update available for theme agora_theme (1.0.7). Release: Automated Revision Log 1.1.3 Minor update available for module ai_revision_log (1.1.3). Release: Views HTTP Client 1.0.4 Minor update available for module views_http_client (1.0.4). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Module Revived: ЮKassa (YooMoney) для Drupal v7 2.6.1 Module yoomoney_api updated after 7 months of inactivity (2.6.1).

Views Cumulative Field

656 sites Security covered Drupal 8–11

Part of the Views ecosystem · 207 projects

View on drupal.org

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.

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jan 2025
Latest release
6 months ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

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