Creating Rules Statements for the Inventory Cube
The Fishcakes International model fills inventory from purchases, and depletes inventory as production proceeds.
To fill inventory, you need to create several rules statements for the Inventory cube that accurately define how to transform purchase data. The statements must accomplish the following:
- Only values for Total Markets in the Purchase cube are moved to the Inventory cube. This is because the Inventory cube does not track values by individual market and does not include the Market dimension.
- Values for each fish type in the Purchase cube must be moved to the corresponding fish type in the Inventory cube. The two cubes share the FishType dimension.
- Values for each date in the Purchase cube goes to the same date in the Inventory cube. The two cubes share the Date dimension.
- Values for Quantity Purchased - Kg in the Purchase cube are moved to Quantity in Stock - Kg in the Inventory cube.
- For any given date, values for newly purchased fish in the Purchase cube are moved to element 1 of the DaysOld dimension in the Inventory cube.
The DaysOld dimension contains elements that reflect the age of fish in inventory. Newly purchased fish is considered to be one day old. In a later section, you develop rules to cycle inventory through the DaysOld dimension on a daily basis as the inventory ages.