Am looking at making a TM1 model (which calculates housing rents) a little more efficient, just looking at the rules it raised my curiosity which is the best way to write a rule,
Option 1
Code: Select all
['Formula Rent Calc A']=N:
if(NUMBR(SUBST(!Year,1,4)) > NUMBR(SUBST(!UH_Versions,1,4)),
DB('UH_Current_Year_Account_Values',!Year,!UH_Versions,!UH_House_Acc,!UH_Debit_Type,'Bed Weighting') *
DB('UH_Debit_Code_Assumptions',!Year,!UH_Versions,!UH_Debit_Type,'National Average Rent') *
DB('UH_Debit_Code_Assumptions',!Year,!UH_Versions,!UH_Debit_Type,'Relative County Manual Earnings'),STET);
Code: Select all
['Formula Rent Calc A']=N:
DB(if(NUMBR(SUBST(!Year,1,4)) > NUMBR(SUBST(!UH_Versions,1,4)),'UH_Current_Year_Account_Values', Stet), !Year,!UH_Versions,!UH_House_Acc,!UH_Debit_Type,'Bed Weighting')
*
DB(if(NUMBR(SUBST(!Year,1,4)) > NUMBR(SUBST(!UH_Versions,1,4)),'UH_Debit_Code_Assumptions', Stet), !Year,!UH_Versions,!UH_Debit_Type,'National Average Rent')
*
DB(if(NUMBR(SUBST(!Year,1,4)) > NUMBR(SUBST(!UH_Versions,1,4)),'UH_Debit_Code_Assumptions', Stet), !Year,!UH_Versions,!UH_Debit_Type,'Relative County Manual Earnings');
The rule is currently as per option 1 but was thinking of changing it to option 2, I doubt it will make little difference but am interested what might be considered best practice
cheers, Mark