## Overview

The following sample query is based on a inventory cube which is a copy of the delivered demo content cube 0D_FC_C05 (see queries available in transaction RSFC -> Analytic Engine -> Non-Cumulatives, more information is available here: transaction RSFC and KBA 1508237). We follow the explanations of note 1548125 (in particular chapter [VI]) and check a stock value displayed in the query with the help of transaction LISTCUBE. Afterwards we do the same by using transaction **NCUM_CAL** (note 2290290 - Non-Cumulative keyfigure value calculation Report)

- cube STPE_NCUM (copy of 0D_FC_C05)
- Non-Cumulative Key Figure: 0D_FC_N_STK
- Inflow: 0D_FC_K_IN
- Outflow: 0D_FC_K_OUT

- Sample query with following filters
- Material = FC004
- 0calday = 26.06.2013

- We check the value of the key figure 'Stock Balanace' which is 12.

Query Result

## Using LISTCUBE

We use the Key Figure Definition in oder to get all relevant restrictions for the cell.

These restrictions can now be used in LISTCUBE. We proceed as follows:

- Determine Marker value(M) by selecting 0recordtp=1
- Calculate sum of all uncompressed Request: SUM(deltas with requestid>0)
- Calculate the Current Stock Value: CSV = M + SUM(deltas with requestid>0)
- Calculate sum of all with time less than given time selection by user: SUM(deltas with time>t)
- Calculate Non-Cumulative Value(t): Value(t) = CSV - SUM(deltas with time>t)
- Compare this value with the query result

##### 1. Determine Marker (0RECORDTP = 1)

Result:

M = 2 |

##### 2. Calculate sum of all uncompressed Request: SUM(deltas with requestid>0)

Result:

SUM(deltas with requestid>0) = 23 -14 = 9 |

##### 3. Calculate the Current Stock Value: CSV = M + SUM(deltas with requestid>0)

CSV = 2 + 9 = 11 |

##### 4. Calculate sum of all with time less than given time selection by user: SUM(deltas with time>t)

Result

SUM(deltas with time>t) = 6 - 7 = -1 |

##### 5. Calculate Non-Cumulative Value(t): Value(t) = CSV - SUM(deltas with time>t)

Stock Value(26.06.2016) = 11 - (-1) = 12 |
---|

##### 6. Compare this value with the query result

Query reult is correct!

## Using Transaction NCUM_CAL** **

As of BW73017 (see note 2290290 - Non-Cumulative keyfigure value calculation Report), you can also use transaction NCUM_VAL (or report RSDD_NCUM_VAL) to calculate stock values. The main advantage is that you get information displayed how exactly the value was calculated. Basically the steps carried out above are done in this report and the result of each step can be found in the log.