CUMMULATIVEX
- The CUMMULATIVEX function in Infoveave is used to calculate the cumulative total of a numerical column, based on specified condition.
- 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, when the specified condition is set true.
Return Value
The return value of the CUMMULATIVEX function is a numerical column containing the cumulative totals for each row in the dataset, based on the specified condition.
Remark
- The CUMMULATIVEX function is useful for calculating cumulative totals based on specific conditions, allowing you to analyze trends and patterns in data within certain criteria.
- CUMMULATIVEX function is applicable only for numeric values.
- It does not take nulls and blanks into account.
Syntax
CUMMULATIVEX(<expression>,<condition>)
CUMMULATIVEX in Board Expression
Expression | A placeholder in a function that is replaced with the actual widget and measure names. |
---|---|
Condition | A placeholder in a function that is replaced with the condition filter. |
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. |
Dimension | Represents the dimension column that is being displayed or analyzed using the widget. |
Dimension Value | Represents the specific dimension items within the dimension column used for the visualization in the widget. |
Steps to Use CUMMULATIVEX
- Write the CUMMULATIVEX function. For instance
CUMMULATIVEX(<expression>,<condition>)
- Where
expression
equals'Widget Name'[Measure]
andcondition
equals[Dimension Name]="Dimension Value"
.Replace Widget Name with the actual name of your widget, Measure with the required measure name, Dimension with the required dimension name and Dimension Value with the dimension value of the selected dimension name. - To learn how to configure an Expression in Infoveave, visit the section Configure Expression.
Scenario 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.
Scenario Details
- Dashboard Name Energy Dashboard
- Widget Name Total Customer
- Measure Name Customers (representing the number of customers)
- Dimension Discount Types (categorizing customers based on their payment behavior)
- Dimension Value “Pay on Time” (representing customers who pay their bills on time)
You can use the CUMMULATIVEX function like this
(CUMMULATIVEX ('Total Customers'[Customers]),[Discount Type]="Pay on Time") > 7000000
CUMMULATIVEX in Calculated Columns
Expression | A placeholder in a function that is replaced with the column names. |
---|---|
Condition | A placeholder in a function that is replaced with the condition filter. |
Column Name | The name of the column in the dataset or Datasource that contains the values you want to analyze. |
Filter Condition | A filter condition returns the data points that meet the defined condition that you want to analyze. The filter condition can be either a string or a numeric. |
Write the CUMMULATIVEX function. For instance
CUMMULATIVEX(<expression>,<condition>)
- Replace
<expression>
with required[Column Name]
and<condition>
equals[Column Name]="Filter Condition"
- Replace Column Name with the actual name of your column and Filter Condition with the required condition to be applied on the columns.
- To learn how to add calculated columns in Infoveave, visit the section Calculated Columns under Sources.
Objective Consider that you have the below sales dataset, your goal is to find the cumulative sum of QUANTITY where COUNTRY is Japan.
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 |
You can use the CUMMULATIVE function like
CUMMULATIVEX([QUANTITY] , [COUNTRY]="Japan")
The new calculated column “Cumulative Quantity” will be
ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY | CUMMULATIVE QUANTITY |
---|---|---|---|---|---|---|
03-01-2024 | Brazil | Baby Food | 38.41 | 43.7874 | 2 | 0 |
07-01-2024 | Japan | Spices | 45.56 | 50.8155 | 20 | 20 |
Japan | 43.7874 | 10 | 30 | |||
18-01-2024 | 32.3019 | 4 | 30 | |||
22-01-2024 | Brazil | Cosmetics | 28.335 | 23.0109 | 7 | 30 |
26-01-2024 | Canada | 20.185 | 23.0109 | 9 | 30 | |
04-01-2024 | France | Cereal | 25.26 | 28.7964 | 9 | 30 |
09-01-2024 | Brazil | Cereal | 44.575 | 50.8155 | 8 | 30 |
14-01-2024 | Brazil | Snacks | 20.185 | 4 | 30 | |
Brazil | Cosmetics | 40.485 | 46.1529 | 2 | 30 |