Replace hard coded rule values with cube value

Post Reply
Mark RMBC
Regular Participant
Posts: 163
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Replace hard coded rule values with cube value

Post by Mark RMBC » Wed Aug 29, 2018 11:34 am

Hi all,

I have a task to make a model more dynamic, as there are literal values in some rules. For example how far the rules project into the future years is a literal value of 4.

So an example of a current rule and feeder is as follows

Rule:

Code: Select all

['AppHrs'] = N:
	DB(If(Numbr(!Year) > DB('Admin_Cube', 'General', 'CurrentYrN') & Numbr(!Year) < DB('Admin_Cube', 'General', 'CurrentYrN')+4,
		'StaffingCube',stet),
           !Employee, !JobNumber, !CostCentre, !Detail, attrs('Year',!Year,'PrevYear'), !Versions, 'AppHrs');
Feeder:

Code: Select all

[' AppHrs '] =>
	DB(If((Numbr(!Year) >= DB('Admin_Cube', 'General', 'CurrentYrN') & Numbr(!Year) < DB('Admin_Cube', 'General', 'CurrentYrN')+3) &
	DB('StaffingCube', !Employee, !JobNumber, !CostCentre, !Detail, !Year, !Versions, 'ActiveProject') @<> 'No',
		'StaffingCube',stet),
           !Employee, !JobNumber, !CostCentre, !Detail, attrs('Year',!Year,'NextYear'), !Versions, 'AppHrs');
The proposed changes are:

Rule:

Code: Select all

[' AppHrs '] = N:

	DB(If(Numbr(!Year) > DB('Admin_Cube', 'General', 'CurrentYrN') & Numbr(!Year) <= DB('Admin_Cube', 'General', 'CurrentYrN') + DB('Admin_Cube', 'MTFS', 'FutureYearsCount'),
		''StaffingCube',stet),
           !Employee, !JobNumber, !CostCentre, !Detail, attrs('Year',!Year,'PrevYear'), !Versions, 'AppHrs');
Feeder:

Code: Select all

[' AppHrs '] =>

	DB(If((Numbr(!Year) >= DB('Admin_Cube', 'General', 'CurrentYrN') & Numbr(!Year) < DB('Admin_Cube', 'General', 'CurrentYrN') + DB('Admin_Cube', 'MTFS', 'FutureYearsCount')) &
	DB('StaffingCube', !Employee, !JobNumber, !CostCentre, !Detail, !Year, !Versions, ' ActiveProject ') @<> 'No',
		'StaffingCube',stet),
           !Employee, !JobNumber, !CostCentre, !Detail, attrs('Year',!Year,'NextYear'), !Versions, 'AppHrs');
So basically the literal value 4 has been replaced by a lookup to cube intersection, DB('Admin_Cube', 'MTFS', 'FutureYearsCount').

So if the client ever wanted to project 5 years into the future and not 4 they would update the admin cube, rather than a need to update all the rules.

Can anyone point to any pitfalls with this approach or things that need to be taken into account?

Cheers, Mark

User avatar
jim wood
Site Admin
Posts: 3609
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: TM1 10.2.2
Excel Version: 2007
Location: 1639 Route 10, Suite 107, Parsippany, NJ, USA
Contact:

Re: Replace hard coded rule values with cube value

Post by jim wood » Wed Aug 29, 2018 4:54 pm

When your lookup changes you'll need to re-compile your feeders. Unless something has changed that's always been the case variable feeders.
Struggling through the quagmire of life to reach the other side of who knows where.
Application Consulting Group (ACG) TM1 Consulting
OS: Windows 10 64-bit. TM1 Version: 10.2.2

Mark RMBC
Regular Participant
Posts: 163
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: Replace hard coded rule values with cube value

Post by Mark RMBC » Thu Aug 30, 2018 10:39 am

Hi Jim,

Really appreciate the response, thanks.

There are already TI processes that re-compile the feeders via CubeProcessFeeders, so I think that issue is covered Also the servers are shut down and restarted once a week.

cheers, Mark

Post Reply