---
title: CUMMULATIVE
description: Calculate running totals with CUMMULATIVE function, enhancing data analysis by computing cumulative sums of numeric columns.
---
import { Aside, Steps } from '@astrojs/starlight/components';

# CUMMULATIVE

The CUMMULATIVE function in Infoveave is used to calculate the cumulative total of a numerical column in a dataset. It computes the running total of the values in the column, where each row’s total includes the current row’s value plus the total from all previous rows.

## Applicable to

* Calculated Columns
* Expressions

## Return Value

The return value of the CUMMULATIVE function is a numerical column containing the cumulative totals for each row in the dataset.

## Remark

* The CUMMULATIVE function is useful for analyzing trends and patterns in data over time.
* It allows you to see how a particular value accumulates or grows over a series of observation.
* CUMMULATIVE function is applicable only for numeric values.
* It does not take nulls and blanks into account.

## Syntax

```
CUMMULATIVE(<expression>)
```

## CUMMULATIVE in Board Expression

<Aside>
Expressions help you add visual effects to your dashboard through widget-specific conditions. It is important to note that the Expressions are not meant to manage or modify data.
</Aside>



| Expression                     | A placeholder in a function that is replaced with the actual widget and measure names. |
| ------------------------------- | ---------------------------------------------------------------------------------- |
| Widget Name                     | The specific name or identifier of the widget being used for data visualization in the specific Infoboard. |
| Measure                         | Represents the name of the measure that is being displayed or analyzed using the widget. |


Steps to Use CUMMULATIVE

<Steps>
1. Write the CUMMULATIVE function. For instance ```CUMMULATIVE(<expression>)```
2. Replace `<expression>` with `'Widget Name'[Measure]`.Replace **Widget Name** with the actual name of your widget and **Measure** with the corresponding measure name.
3. To learn how to configure an Expression in Infoveave, visit the section [Configure Expression](/insights-v8/advanced-configuration/#configuring-expressions).
</Steps>

<div class="elementor-alert" role="alert">
  <span class="elementor-alert-title">Example</span>
  <span class="elementor-alert-description">
    **Scenario**
    <ul>
      <li>Imagine you are managing an Energy Dashboard, and you want to define a specific action based on a condition using Expressions. Let the condition to meet in this example be that you're calculating the cumulative sum of customers and you want to trigger a specific action if this is greater than 7000000.</li>
    </ul>
    **Scenario Details**
    <ul>
      <li><strong>Dashboard Name</strong> Energy Dashboard</li>
      <li><strong>Widget Name</strong> Total Customer</li>
      <li><strong>Measure Name</strong> Customers (representing the number of customers)</li>
    </ul>
    <ul>
      <li>You can use the CUMMULATIVE function like this</li>
    </ul>
    ```
(CUMMULATIVE ('Total Customers'[Customers])) > 7000000
    ```
  </span>
</div>

## CUMMULATIVE in Calculated Columns



| Expression | A placeholder in a function that is replaced with the column names. |
|------------|-----------------------------------------------------------------|
| Column Name | The name of the column in the dataset or Datasource that contains the values you want to analyze. |


* Write the CUMMULATIVE function. For instance

```
CUMMULATIVE(<expression>)
```
<Steps>
1. Replace `<expression>` with `[Column Name]`.Replace **Column Name** with the actual name of your column required. 
2. To learn how to add calculated columns in Infoveave, visit the section [Calculated Columns](/studio-v8/datasources/calculated-columns-datasource/).
</Steps>

<div class="elementor-alert" role="alert">
  <span class="elementor-alert-title">Example</span>
  <span class="elementor-alert-description">
    **Objective** Consider that you have the below sales dataset, your goal is to find the cumulative sum of QUANTITY.

| ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY |
|---|---|---|---|---|---|
| 2024-01-03 | Brazil | Baby Food | 38.41 | 43.7874 | 2 |
| 2024-01-07 | Japan | Spices | 45.56 | 50.8155 | 20 |
|  | Japan |  |  | 43.7874 | 10 |
| 2024-01-18 |  |  |  | 32.3019 | 4 |
| 2024-01-22 | Brazil | Cosmetics | 28.335 | 23.0109 | 7 |
| 2024-01-26 | Canada |  | 20.185 | 23.0109 | 9 |
| 2024-01-04 | France | Cereal | 25.26 | 28.7964 | 9 |
| 2024-01-09 | Brazil | Cereal | 44.575 | 50.8155 | 8 |
| 2024-01-14 | Brazil | Snacks | 20.185 |  | 4 |
|  | Brazil | Cosmetics | 40.485 | 46.1529 | 2 |

<ul>
  <li>You can use the CUMMULATIVE function like</li>
</ul>

```
CUMMULATIVE([QUANTITY])
```

The new calculated column "Cumulative Quantity" will be

| ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY | CUMULATIVE QUANTITY |
|---|---|---|---|---|---|---|
| 03-01-2024 | Brazil | Baby Food | 38.41 | 43.7874 | 2 | 2 |
| 07-01-2024 | Japan | Spices | 45.56 | 50.8155 | 20 | 22 |
|  | Japan |  |  | 43.7874 | 10 | 32 |
| 18-01-2024 |  |  |  | 32.3019 | 4 | 36 |
| 22-01-2024 | Brazil | Cosmetics | 28.335 | 23.0109 | 7 | 43 |
| 26-01-2024 | Canada |  | 20.185 | 23.0109 | 9 | 52 |
| 04-01-2024 | France | Cereal | 25.26 | 28.7964 | 9 | 61 |
| 09-01-2024 | Brazil | Cereal | 44.575 | 50.8155 | 8 | 69 |
| 14-01-2024 | Brazil | Snacks | 20.185 |  | 4 | 73 |
|  | Brazil | Cosmetics | 40.485 | 46.1529 | 2 | 75 |
  </span>
</div>
