Understanding How KPI Values are Calculated When Other KPIs are Referenced
Understand how KPI is calculated.
Required Editions
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled |
Here’s the structure of a formula to calculate KPIs.
(Param1,Param2,...,Paramn) =>
{
return (Param1+Param2+...+ Paramn);
}The string consists of three parts:
- Input parameters—
(Param1, Param2, ..., Paramn) - Arrow
- Algorithm—
{ return Param1 + Param2 + ... + Paramn; }
Only the defined input parameters can be accessed for calculation, with one exception: calcHelper, which is a collection of functions, can be accessed even if it isn’t specified as an input parameter.
Provide one of these options as an input parameter for a formula:
- Other KPIs of the same granularity
- Other KPIs of a coarse granularity
- Available dimensions
Granularity is the level from where the requested value is taken. The usable levels are defined via the dimensions on the Y-axis, which is a KPI measure, tactic, or product. You can’t access the value at the tactic level if the KPI is tactic-independent.
The system checks for self-references and terminates the calculation if a self-reference is found. The system doesn’t check for circular references, which means that if KPI A references KPI B, and KPI B references KPI A, the calculation can’t be successful.
- Example: Referencing Other KPIs of the Same Granularity
You can specify other KPIs as an input parameter in a formula. - Example: Referencing Other KPIs of Different Granularity
For some KPIs, you can reference the aggregated value of another KPI, for example, when calculating the percentage of volume of the current tactic that is contributed by the current product. - Example: Referencing Total Values of Other KPIs with Different Granularity
You can reference the total value of a KPI with a different granularity to calculate the values of a KPI. - Example: Referencing Variables
Depending on the scope of a KPI, you can reference a promotion or a tactic variable in a formula. - Example: Calculating KPIs of Subperiod Time Granularity
This example shows how a calculated or editable calculated KPI of time granularity subperiod is calculated when KPIs with time granularity period are included in the KPI formula.

