addition "IF" rule effect on view calculation time

Post Reply
User avatar
ioscat
Regular Participant
Posts: 209
Joined: Tue Jul 10, 2012 8:26 am
OLAP Product: Contributor
Version: 9.5.2 10.1.1 10.2
Excel Version: 07+10+13
Contact:

addition "IF" rule effect on view calculation time

Post by ioscat »

Hello, forum!

We use IF statement to close some cells from other rules apply.

Code: Select all

..=N: IF (<statement>, 0, continue);
after that we set calculation rule

Code: Select all

..=N: <complicated rule that calculates some value>;
Calculation time of these two rules about two times larger than applying only second rule (50 sec vs 30 sec). Is it normal (or even ever possible) behavior? Or maybe we are using extremely ineffective syntax?
whitej_d
Community Contributor
Posts: 103
Joined: Mon Sep 05, 2011 11:04 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Re: addition "IF" rule effect on view calculation time

Post by whitej_d »

How many conditions are there in the IF statement? I've found anecdotally that IF statements with more than 2 conditions perform much slower, but that could have been down to something else.

I have used something similar in the past to achieve a performance improvement.
User avatar
ioscat
Regular Participant
Posts: 209
Joined: Tue Jul 10, 2012 8:26 am
OLAP Product: Contributor
Version: 9.5.2 10.1.1 10.2
Excel Version: 07+10+13
Contact:

Re: addition "IF" rule effect on view calculation time

Post by ioscat »

I separated several statements in different strings because of their nature. For example first if case closes all abandoned objects for year X, second if case closes cells for non mapped elements of cube dimensions... It's easier to read them, than dozen of nested statements.

But while we are developing model, we use only first if statement and already have got significant calculation time expansion. I can add that if statement is false almost all cells, so all two rules are applied to almost all cells.

Will it have effect if set if conditions in auxilary cube with less detail and after that set simple if-rule "if (DB(..)=0,0, continue)"? But original statement is not heavy

Code: Select all

['Income']=N:IF(ATTRN('Years',!Years,'Numeric')<DB('properties', !Cities, ... , 'Shop Opening Year'),0,continue);
In this rule we set income of not built markets to zero.

Second (calculation) rule is not really heavy too

Code: Select all

['Income]=N:DB(<PreCalculated Income>)
that is as I suppose cached to stargate in auxiliary cube with less detail and calculates as simply multiplication

Code: Select all

[Price] x [Quantity]
Post Reply