05.02 Conditional Calculations

Conditional calculations are defined in the Calculations dialog as extensions of simple calculations; the default expression to be executed is defined just like any other simple calculation but then one or more override expressions are defined which are executed instead of the default when specified criteria are met.

Lets look at a simple example for a P&L: instead of just displaying actuals as stored in the ERP, we want to multiply the credits by -1 so that the numbers displayed in the P&L are all positive regardless of whether they are debits or credits.

So, we might define a new calculation called “Display Amount” which as a default, simply displays the Actuals from the ERP:

c9df7044-3c91-47e9-8ed7-0a25ec2ba22c

But it might then define a conditional override, that for a range of account codes, displays the Actuals multiplied by -1

54c57327-05b7-4940-8911-f8a6203f5bcf

Conditional calculations are denoted in the calculation screen with this symbol:

ef08dfd6-cec2-485f-8df0-fa0a94ea6c20
b7750ae6-6a02-46f2-8379-a186993dab2c

What we have defined here then is a new calculation called “DisplayAmount” whose default expression is [Measures].[Balance] with an override on the Account dimension for the range 4000 to 4999 when the expression [Measures].[Balance]*-1 should be executed instead.

Leading to a result report that might look like this:

cd076e7c-8f5b-439d-a987-0f60ed63ce6b

If on the other hand we wanted to only show credits and not debits, we could amend the default expression to [Measures].[Balance] * 0  in effecting causing only the inverted credits to come through.

Using Conditionals to Restrict an Expression

Where the need is to restrict an expression from operating on certain zones of the dataset, rather than override it, the trick is as above, to set the default expression to something that will evaluate to 0 (eg: [Measures].[Balance] * 0  ) with the actual expression configured as an override.

Common uses for conditional calculations include:

Along with many other more specific scenarios caused by exceptions in the way that a company handles data in its ERP.

Exercises and Tutorial Survey

05 Advanced Calculations - Conditional Calculations - Exercises.pdf

Your feedback helps us do better, to fill in a short survey on this tutorial, click here.

Powered By