You already have all the knowledge required to construct
the rules statements for the Inventory rule.
Before you begin
For more information about how to construct DB functions
using the features of the Rules Editor, see Exchange rates.
Procedure
- Right-click the Inventory cube in the Server
Explorer, and click Create Rule.
The Rules Editor displays. You have not yet
written any rules statements for the Inventory cube, so the editor
is empty.
- Create the following three statements in the Rules Editor.
['1','Quantity in Stock - Kgs']= N:DB('Purchase',!FishType,'Total
Markets',!Date,'Quantity Purchased - Kgs');
['1','Purchase Cost'] = N:DB('Purchase',!FishType,'Total Markets',!Date,'Purchase
Cost - USD');
['1','Average Purchase Price/Kg'] = N:['1','Purchase
Cost'] \ ['1','Quantity in Stock - Kgs'] ; C:0 ;
- Click Save.
- Open the Jun - 16 inventory view of the Inventory cube
to confirm that these statements calculate values as expected.
Note: The rules statements calculate values only
for DaysOld batch 1. In later sections, you develop additional statements
for the Inventory rule that calculate values for all other DaysOld
batches.