Loading
Connect in real time with the Trailblazer Community in Slack Open BetaRead More
Set Up Trade Promotion Management
Extend the TPE Analytics Semantic Data Model

Extend the TPE Analytics Semantic Data Model

To add a KPI that isn't in the included selector lists, add your own parameter and calculated measure directly to the Extended_Trade_Promotion_Management_Analytics model. Salesforce doesn't upgrade this model on app releases, so your additions are preserved. Then clone the included Promotion Analysis or Tactic Analysis dashboard and bind your new parameter to a selector and your calculated measure to a chart. Don't modify the included dashboards, clone them and modify the clone.

Required Editions

Available in: Lightning Experience

Available in: Enterprise, Performance, and Unlimited Editions where Trade Promotion Management and Data 360 is enabled

Note
Note Because upgrades overwrite standard dashboards and visualizations, clone them before making changes. Upgrades don't overwrite the Extended TPMA SDM, so you can customize it directly.

Data Requirements

These requirements follow from the included model's measure-code architecture.

  • Your custom KPI's measure code and display name exist as a row in the MeasureDefinition_std__dlm DMO.
  • The fact table for the KPI's level contains rows for those measure codes.
    • Promotion-level KPIs: PromotionProductMeasure_std__dlm in the Measure_Value column
    • Tactic-level KPIs: PromotionOfferProductMeasure_std__dlm in the Measure_Value3 column

Custom Parameter Pattern

Define your custom parameter with these properties. The pattern matches the included parameters.

property value notes
API name <Your_Parameter_Name>_prm Match the _prm suffix used by the included parameters, such as Promotion_Measure_1_prm and Tactic_Measure_1_prm.
Label User-friendly name Appears in the semantic model builder.
Allowed values List of {displayName, value} pairs value is a measure code from MeasureDefinition_std__dlm. The dashboard dropdown shows the displayName. The parameter passes value to the calculated measure.

Custom Calculated Measure Patterns

Custom calculated measures reuse the included expression patterns. Values come from the base model's fact tables.

Promotion-level KPI:

IF [Parameters].[<Your_Parameter>] == [Measure_Definition].[Measure_Code]
THEN [Promotion_Product_Measure].[Measure_Value]
ELSE null
END
Property values
Aggregation type Sum
Data type Number
Level Row

Tactic-level KPI:

IF [Parameters].[<Your_Parameter>] == [Measure_Definition].[Measure_Code]
THEN [Promotion_Offer_Product_Measure2].[Measure_Value3]
ELSE null
END
Property values
Aggregation type Sum
Data type Number
Level Row

Variance (actuals versus planned):

For an actuals-versus-planned variance chart, define a second parameter and calculated measure for the planned side, and then define a variance measure that returns the percent difference.

IF (SUM([<Your_Measure_2>]) != 0)
THEN (((SUM([<Your_Measure_1>]) − SUM([<Your_Measure_2>])) / SUM([<Your_Measure_2>])) * 100)
ELSE null
END
Property values
Aggregation type UserAgg
Data type Number
Level AggregateFunction

The measure returns null when the denominator is 0 to avoid a division-by-zero error.

Dashboard Binding

  • Clone the visualizations: On the included dashboard, clone each visualization you want to customize. For new visualizations, replace the shipped parameters and measures with new ones.
  • Clone the dashboard: Clone the included Promotion Analysis or Tactic Analysis dashboard, and replace the shipped visualizations on the clone with your cloned ones.

Considerations

  • Don't edit the base model. Salesforce upgrades Trade_Promotion_Management_Analytics on app releases. Any changes there are overwritten. Add your parameters and calculated measures to Extended_Trade_Promotion_Management_Analytics instead. Salesforce doesn't upgrade the extended model, so your changes are preserved.
  • Don't edit the shipped dashboards or visualizations. Clone them and modify the clones. This keeps the shipped artifacts intact for reference.
  • Match an included parameter scope when you can. The included selectors group KPIs by scope: actuals-only, actuals and LE, planned, or actuals and funding. If your custom parameter mixes scopes, the meaning of your selector diverges from the included ones and comparisons across dashboards get harder.
  • Don't mix grains in a single parameter. Keep promotion-level codes and tactic-level codes in separate parameters. A calculated measure reads from one fact table only, so a mixed-grain parameter can't be resolved correctly.

Don't edit the shipped dashboards, selectors, or charts. Clone them and modify the clones. This keeps the shipped artifacts intact for reference.

 
Loading
Salesforce Help | Article