First Try: Sequential Monthly Statements

The simplest solution is to write a separate rule statement for each month.

For previous months, you want to bring in actuals from the Production cube; for future months, you want to generate estimates within the Plan cube by applying the Adj. % from last month number. Assuming that you are writing the rules in March, this means that you take actuals values for January and February from the Production cube, then generate the rest of the values from the adjustment percentages.

The rule statements for the Plan cube would look like this:

['January','Planned Production Qty - Kgs']=
DB('Production',!CakeType,!Month,'Quarterly Producd - Kgs');

['February','PlannedProduction Qty - Kgs']=
DB('Production',!CakeType,!Month','Quarterly Produced - Kgs');

['March','Planned Production Qty - Kgs']=
['February','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'March','Adj. % from last month');

['April','Planned Production Qty - Kgs']=
['March','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'April'.'Adj. % from last month');

['May','Planned Production Qty - Kgs']=
['April','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'May','Adj. % from last month');

['June','Planned Production Qty - Kgs']=
['May','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'June','Adj. % from last month');

['July','Planned Production Qty - Kgs']=
['June','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'July','Adj. % from last month');

['August','Planned Production Qty - Kgs']=
['July','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'August','Adj. % from last month');

['September','Planned Production Qty - Kgs']=
['August','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'September','Adj. % from last month');

['October','Planned Production Qty - Kgs']=
['September','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'October', 'Adj. % from last month');

['November','Planned Production Qty - Kgs']='
['October','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'November'.'Adj. % from last month');

['December','Planned Production Qty - Kgs']=
['November','Planned Production Qty - Kgs']
*DB('Plan',!CakeType,'December'.'Adj. % from last month');

As the following view of the Plan cube illustrates, this rule accomplishes the job of moving data into the Plan cube from the Production cube for the months of January and February. The rule also correctly calculates planned Production Quantity Values for the months of March through December.

Example of using a rules statement in a Plan cube

This solution has the advantage of being easy to write and understand, but has significant limitations:

  • It is excessive to have to write twelve separate statements, one for each month.
  • The statements need to be changed each month as the year advances (new values from the Production cube have to be brought into the Plan cube each month, requiring a change to the statements).
  • If the associated feeders are similarly hard-coded, they too will need to change each month.