Rule Efficiency

Post Reply
MarenC
Regular Participant
Posts: 350
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Rule Efficiency

Post by MarenC »

Hi,

Which of the following rules is the more efficient or in the following case is there no real material difference? :

Code: Select all

['Forecast', 'Annual Revenue'] = N:
	(DB('Revenue', !Version, !Period, !Dept , 'Total Revenue')
	+ DB('Revenue', !Version, ATTRS('Period', !Period, 'Period n-1'), !Dept, 'Total Revenue')
	+ DB('Revenue', !Version, ATTRS('Period', !Period, 'Period n-2'), !Dept, 'Total Revenue'))
	* 4;

Code: Select all

['Forecast', 'Annual Revenue'] = N:
	 DB('Revenue',!Version, !Period | 'Previous', !Dept, 'Total Revenue') *4;
The second statement uses a consolidation, which has child of period, period -1 and period -2.

Maren
Last edited by MarenC on Thu Jul 09, 2020 11:08 am, edited 1 time in total.
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Rule Efficiency

Post by Wim Gielis »

Performance-wise, go for the second option. Though there is N: and N: but you will have noticed that I guess, and also a parenthesis too much.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
MarenC
Regular Participant
Posts: 350
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: Rule Efficiency

Post by MarenC »

thankyou Wim. (and what errors :D )

Just a follow up, how would you feed this statement. I was thinking I had 2 options, either take out the N: and make the rule apply to C and N level
or

Have 3 feed lines one for each period, so one current period, 2 next period

Maren
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Rule Efficiency

Post by Wim Gielis »

Feed the underling N level cells ( 'Forecast', 'Annual Revenue' ) based on the driver values.
They will feed into the future 1/2 periods, or stay within the same period.
Or, use a different value to feed from, if you know that makes sense business-wise.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
scrumthing
Posts: 81
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 11.x
Excel Version: MS365

Re: Rule Efficiency

Post by scrumthing »

Wim Gielis wrote: Thu Jul 09, 2020 11:03 am Performance-wise, go for the second option. Though there is N: and N: but you will have noticed that I guess, and also a parenthesis too much.
I would say second option as well. in general consolidation is faster for aggregation then rules because of the sparse consolidation algorithm and stuff... (please don't ask me for a detailed explanation. There are others here to explain it much better.)
There is no OLAP database besides TM1!
Post Reply