Rule Design for Conditional Statements
Posted: Mon Jan 27, 2014 3:35 pm
This question pertains to handling cubes with lots of conditional statements and, if has been addressed, I've simply missed it.
The cube in question is a calculation cube for a staffing model. The users enter information into a input cube that essentially has Cost Centers, Slots, and Measures. The measures dimensions has items like Effective date, job title, base salary, job code, job status. There are a number of actions that can occur such as a transfer to another cost center or a position could be deactivated (an approved position, but not filled). There are dozens of these items which the user makes entries that determine calculation results. Each employee or position is entered into a single "Slot" in the appropriate Cost Center. If a CC has five staff positions, Slots 1-5 will have an entry.
The Calc cube (with dimensions Cost Center, Slots, Measures AND Months) then takes this information and spreads it out across the budget period on a monthly basis. So a staff member is promoted in April, then starting in April, that position calculates a new monthly salary, taxes, etc. Lots of conditional rules, lookup cubes and attributes used in this cube. Of course, the Calc cube is sparse as only a fraction of Cost Centers approach the Slot limit (125), most having fewer than 10 employees or positions. There are approximately 160 rules.
The Summary cube (dimensions; Cost Center, Months and Measures) simply summarizes the information from the Calc cube by Cost Center and Months
The question is how to best approach the rules in the calc cube. Is it better to STET cells at the beginning of the rules file and then write simpler rules OR repeat the same conditionals in every rule. For example, If the context month is less than the effective date, we do not want to calculate anything. That one conditional applies to every cell.
I approached this by writing a rule at the outset that STETS all cells with the context month less than the effective date and the following rules are much simpler. However, that kind of goes against the grain of published rule design which is STET small areas and then write rules to cover the bigger area.
Recommendations? Practical Experience?
Recommendations?
The cube in question is a calculation cube for a staffing model. The users enter information into a input cube that essentially has Cost Centers, Slots, and Measures. The measures dimensions has items like Effective date, job title, base salary, job code, job status. There are a number of actions that can occur such as a transfer to another cost center or a position could be deactivated (an approved position, but not filled). There are dozens of these items which the user makes entries that determine calculation results. Each employee or position is entered into a single "Slot" in the appropriate Cost Center. If a CC has five staff positions, Slots 1-5 will have an entry.
The Calc cube (with dimensions Cost Center, Slots, Measures AND Months) then takes this information and spreads it out across the budget period on a monthly basis. So a staff member is promoted in April, then starting in April, that position calculates a new monthly salary, taxes, etc. Lots of conditional rules, lookup cubes and attributes used in this cube. Of course, the Calc cube is sparse as only a fraction of Cost Centers approach the Slot limit (125), most having fewer than 10 employees or positions. There are approximately 160 rules.
The Summary cube (dimensions; Cost Center, Months and Measures) simply summarizes the information from the Calc cube by Cost Center and Months
The question is how to best approach the rules in the calc cube. Is it better to STET cells at the beginning of the rules file and then write simpler rules OR repeat the same conditionals in every rule. For example, If the context month is less than the effective date, we do not want to calculate anything. That one conditional applies to every cell.
I approached this by writing a rule at the outset that STETS all cells with the context month less than the effective date and the following rules are much simpler. However, that kind of goes against the grain of published rule design which is STET small areas and then write rules to cover the bigger area.
Recommendations? Practical Experience?
Recommendations?