Single-Cube Feeders

Generally speaking, every calculation statement in a rule should have a corresponding feeder statement.

The simplest feeders are those that apply to calculations within one dimension of one cube, where the presence of a non-zero value in one element implies the presence of a non-zero value in another element.

To illustrate this, recall the first calculation statement you created for the Purchase cube in the previous section.

['Purchase Cost - LC']=N:['Quantity Purchased - Kgs']*['Price/Kg
- LC'];

This statement calculates values for the area Purchase Cost - LC. Looking at the statement, you can surmise that if the value for Quantity Purchased - Kgs is zero, the rule returns zero for Purchase Cost - LC. If the value for Quantity Purchased - Kgs is non-zero, then the rule returns a non-zero value as well. (This assume that for a given Quantity Purchased - Kgs there is always a non-zero value for Price/Kg - LC.) In this case, Purchase Cost - LC contains a value only when Quantity Purchased - Kgs contains a value.

To write accurate feeders, you need to focus on which component(s) of a formula determine when a non-zero value is returned to the area.

For example, in the calculation statement above, Purchase Cost - LC is derived from a product involving Quantity Purchased - Kgs. A view of the Purchase cube might look like this:

Screen showing a calculation in the Cube Viewer.

If nothing is bought (Quantity Purchased - Kgs is zero), then nothing is paid (Purchase Cost - LC is also zero). In this case, Quantity Purchased - Kgs is the component of the formula that determines when the rule returns a non-zero value.

Knowing this fact, you can construct the required feeder as follows:

['Quantity Purchased - Kgs']=>['Purchase Cost - LC'];

This feeder says that when there is a non-zero value for Quantity Purchased - Kgs, TM1® should feed a placeholder to Purchase Cost LC.

You can use this same approach to create feeders for the other calculation statements in the rule for the Purchase cube.

The second calculation statement in the rule calculates values for the area Price/Kg - USD.

['Price/Kg - USD']=N:['Price/Kg -LC']\DB('CurrencyExchangeRate', DB('Currency',
!market,'MarketCurrency'),!date); 

Here, the value of Price/Kg - USD is dependent upon the value of Price/Kg -LC. Specifically, Price/Kg - USD is a quotient dependent upon the dividend Price/Kg -LC. You should use Price/Kg -LC to feed Price/Kg - USD.

['Price/Kg -LC']=>['Price/Kg - USD'];

The final calculation statement in the Purchase rule calculates values for the area Purchase Cost - USD.

['Purchase Cost - USD']=N:['Purchase Cost - LC']\DB('CurrencyExchangeRate', 
DB('Currency',!market,'MarketCurrency'),!date);

The value of Purchase Cost - USD is dependent upon the value of Purchase Cost - LC. Similar to the preceding calculation statement, Purchase Cost - USD is a quotient dependent upon the dividend Purchase Cost - LC. You should use 'Purchase Cost - LC to feed Purchase Cost - USD.

['Purchase Cost - LC']=>['Purchase Cost - USD'];