Replace hard coded rule values with cube value

Post Reply
Mark RMBC
Community Contributor
Posts: 292
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 »

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: 3951
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Replace hard coded rule values with cube value

Post by jim wood »

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.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Mark RMBC
Community Contributor
Posts: 292
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 »

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