Conditional Formulas Using Dimension Members
You can create conditional calculations in modeler based on dimensions and their properties.
In the formula bar, you create IF statements that depend on:
-
Members of any dimension in the model.
Examples:
IF ([d/sap.fpa_data:REGION]="DE",[SALES] *2 , [SALES] ) IF ([d/sap.fpa_data:PRODUCT]=("COKE", "SPRITE"),[REVENUE] *1.5, [REVENUE] ) -
Properties of a dimension.
Examples:
IF ([d/sap.fpa_data:VERSION].[p/CATEGORY] = ("ACTUALS") , [Sales] * 2, [Sales] * 3) IF ([d/sap.fpa_data:VERSION].[p/TYPE] = ("public") , [Sales] * 2, [Sales] * 3) IF ([d/sap.fpa_data:PRODUCT].[p/Product_TYPE] = ("A" , "B") AND [Region] = ("CA" , "US"), [Sales] * 2, [Sales] * 3)
For example, consider this scenario:
- Your model contains a Region dimension.
- For the US sales region, you want to multiply the sales figures by 2.
- Otherwise, you want to multiply the sales figures by 3.
You can create a conditional calculation like this:
IF([d/REGION]="US",[SALES]*2,[SALES]*3)
To create this calculation, use the IF function and add the Region dimension to the formula. As you type in the formula bar, dimension names that match the text you have typed are shown. A lower-case ādā indicates a dimension. Instead of typing formulas manually, you can press Ctrl + Space to choose from a list of values that are valid for that location in the formula, or type [ for a list of valid measures and dimensions.