---
schema_version: "1"
id: c641071cf7b988d7209f66b5fc5ab5b759c7be62e5022d3b602a7ff57b18f62d
title: Referencing Variables
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/concept_referencing_variables.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.concept_referencing_variables.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f031787b982bdf90731232e893095a376b76f430e64e79517fa33463a64d5ac1
description: Depending on the scope of a KPI, you can reference a promotion or a tactic variable in a formula.
products:
  - Consumer Goods
release: "264"
---
# Referencing Variables

Depending on the scope of a KPI, you can reference a promotion or a tactic variable in a formula.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
      <colgroup>
        <col>
      </colgroup>
      <tbody>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">
            <p>Available in: Lightning Experience</p>
            <p style="margin-bottom:0;">Available in: <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions where Consumer Goods
              Cloud is enabled</p>
          </td>

        </tr>
      </tbody>
    </table>

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.

![Promotion as Variable](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_trade_promo-264-0-0-production-enus/169b0c8b-175d-4639-bf96-610b16824687/images/icon_example.png)

Promotion as Variable

```
{
    "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.

![Tactic as Variable](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_trade_promo-264-0-0-production-enus/169b0c8b-175d-4639-bf96-610b16824687/images/icon_example.png)

Tactic as Variable

```
{
    "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"
    },
    ...
}
```