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');
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');
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');
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 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