Referencing Variables
Depending on the scope of a KPI, you can reference a promotion or a tactic variable in a formula.
Required Editions
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled |
If the scope of a KPI is Promotion, Promotion Tactic, or Payment Tactic, the KPI can reference the Promotion object. Define the fields of the Promotion object in the Promotion__c.CalculationVariables fieldset. For example, if you have a Phase__c field, then you can add the Promotion object as the input parameter in a formula.
{
"name": "myExampleKPI",
“scope”: “promotion”,
"type": "calculated",
"formula": "(MyKpi1, MyKpi2, Promotion) => { if Promotion.phase === 'Planning') return MyKpi1; else return MyKpi2}",
}(MyKpi1, MyKpi2, Promotion) => { if Promotion.phase ===
'Planning') returns MyKpi1; else return
MyKpi2}
If the scope of a KPI is Promotion Tactic or Payment Tactic, use the Tactic object as the input parameter in a formula. Define the fields of the Tactic object in the Tactic__c.CalculationVariables fieldset.
{
"name": "myReferencedKPI",
"type": "read",
"aggregation": {
"rule": "sum"
},
"totalcalculation": {
"rule": "sum"
},
...
}, {
"name": "myExampleKPI",
“scope”: “promotiontactic”,
"type": "calculated",
"formula": "(myReferencedKPI, Tactic) => { return myReferencedKPI / Tactic.lift;}",
"aggregation": {
"rule": "sum"
},
"totalcalculation": {
"rule": "sum"
},
...
}

