You are on page 1of 11

Concept of Non-cumulative Key Figure in

SAP BI
Concept of Non-cumulative Key Figure
Ncum. value with Ncum. Value change
SAP BW 7.0 and will also work on BW 3.5
Summary
This article explains step by step process about how non-cumulative key figure works in BW. Example of Noncumulative key figure with non-cumulative value change has been taken to explain the concept.
Author:
Company:
Created on:
Author Bio

Prakash Kumar Sahu


Tata Technologies Limited (Pune/India)
12 March 2012

Prakash Kumar Sahu is a SAP BI consultant with more than 3 years of SAP BI/BW experience and currently
working with Tata Technologies Limited (Pune/India). He has got rich experience and worked on various BW/
BI, BPC and BOBJ implementation/Support projects.
Table of Contents
1. Introduction
2. Business Scenario
3. Modeling Creating Non-*** KF
4. Modeling Creating Non-*** InfoCube
5. Modelling Creating Transformation
6. Data Loading and Analysis
7. Understanding Validity Table
8. Sample File for the explained scenario
9. Related Content

Generated by Jive on 2015-08-10+02:00


1

Concept of Non-cumulative Key Figure in SAP BI

1. Introduction
This article explains step by step process about how non-cumulative key figure works in BW. Example of Noncumulative key figure with non-cumulative value change has been taken to explain the concept.
Non-cumulative Key Figure: - A non-cumulative is a non-aggregating key figure on the level of one or more
objects that is always displayed in relation to time. You can determine the current non-cumulative or the noncumulative at a particular point of time. Examples of non-cumulative include headcount (in Human Resources
Management), account balance (in Banking Application) and material inventory (in Inventory Management).
The areas where non cumulative key figures are used are Human Resource Management,
Inventory management and Banking application. Users are more interested to know the
employee headcount, stock value or Account balance information as of date or on a particular
date.
Non-cumulative Key Figures are of two types1. Non-cumulative key figure with non-cumulative value change
2. Non-cumulative key figure with in- and out-flow

Non-cumulative Key Figure With Value Change: - In this case non-cumulative key figure is
mapped using one key figure for non-cumulative changes. The key figure for non-cumulative value
change is normal cumulative key figures that have summation both as aggregation and
exception aggregation.

Generated by Jive on 2015-08-10+02:00


2

Concept of Non-cumulative Key Figure in SAP BI

Non-cumulative Key Figure With in and out flow: - - In this case non-cumulative key figure is
mapped using two key figure for non-cumulative changes. The key figures for capturing non-cumulative
changes i.e. inflows and outflows are normal cumulative key figures that have summation both
as aggregation and exception aggregation.

2. Business Scenario
Let us try to understand how our bank account balance is calculated at any point of time.
Balance Amount = Balance of previous day + transaction amount, if amount is credited
Balance Amount = Balance of previous day - transaction amount, if amount is debited
It is not necessary that transaction will be done everyday by a particular customer. So, our data base
(Infocube) will stores the data of a customers only for the dates on which any transaction is done.
However, when we run the report for any customer, he might be interested to know his balance
amount for the date on which no transaction was done by him. So, report should show the balance
amount on a particular day for which there is no data in the database.
To handle this type of scenario, SAP has provided the concept of non-cumulative key figure.
Let us understand how the modeling can be done in BW to handle this type of scenario using non-cumulative
key figure with non-cumulative value change.

3. Modeling - Creating Non-Cumulative Key


Figure
First create a cumulative key figure Z8_TRAMT (Transaction Amount) with aggregation as SUM and
Exception aggregation as summation.
Create a non-cumulative key figure Z8_BAL (Balance Amount) with aggregation as SUM and
Exception aggregation as Last Value.
Give key figure Z8_TRAMT as Non-cumulative value change under aggregation tab while defining
non-cumulative key figure Z8_BAL.

Generated by Jive on 2015-08-10+02:00


3

Concept of Non-cumulative Key Figure in SAP BI

4. Modeling - Creating Non-Cumulative


InfoCube
Create a Non-cumulative InfoCube Z8_NCKC1(Demo - Non Cumm KF - Val Chng) as shown in the
screenshot below. An InfoCube contains at least one non-cumulative key figure then it is called noncumulative InfoCube.

Generated by Jive on 2015-08-10+02:00


4

Concept of Non-cumulative Key Figure in SAP BI

When we insert non-cumulative key figure Z8_BAL then cumulative key figure Z8_TRAMT is
automatically added by the system in the cube.
We have taken here time characteristic 0CALDAY for Exception Aggregation.
For non-cumulative InfoCube Validity area are maintained in validity table also called L table. We
define the fields or characteristics of validity table in Extras. Maintain non-cumulative value. Most
detailed time characteristics are automatically selected by the system.

Generated by Jive on 2015-08-10+02:00


5

Concept of Non-cumulative Key Figure in SAP BI

5. Modeling - Creating Transformation


Only cumulative key figures are available for transformation.
Create the mapping as below between datasource and InfoCube.

Generated by Jive on 2015-08-10+02:00


6

Concept of Non-cumulative Key Figure in SAP BI

Transaction amount in target is mapped with Transaction amount and credit/debit in


source. Credited amount is stored as +ve value and debited amount is stored as ve
value in data target. Use the following field routine to achieve the same.

**** Logic for Credit/Debit Amount

IF SOURCE_FIELDS-/BIC/Z8_CDIND = 'CR'.

RESULT = SOURCE_FIELDS-/BIC/Z8_TRAMT.

ELSEIF SOURCE_FIELDS-/BIC/Z8_CDIND = 'DR'.

RESULT = ( -1 ) * SOURCE_FIELDS-/BIC/Z8_TRAMT .
ENDIF.

**** Logic for Credit/Debit Amount


For Key Figure maintain the proper currency in rule detail otherwise we will get the error during
activation of transformation.

Generated by Jive on 2015-08-10+02:00


7

Concept of Non-cumulative Key Figure in SAP BI

6. Data Loading and Analysis


Create the necessary DataSource, InfoPackage and DTP to load the data in InfoCube. After loading
the data our cube will store the data as below:-

In the screenshot, we can see that cube stores the data for the date on which some transaction has
st

nd

rd

th

th

been done i.e. 1 , 2 , 3 , and 9 , 12 Jan 2012.

If a customer wants to know his balance amount on 7th Jan 2012 then no records exist in cube.
Credited amount has been stored as +ve and Debited amount has been stored as ve in
InfoCube(field routine has been used)
Checking the data in Query
We have created a query to show value of Balance Amount (non-cumulative) along with Transaction
Amount (cumulative).

Report Output

Generated by Jive on 2015-08-10+02:00


8

Concept of Non-cumulative Key Figure in SAP BI

Initial Balance amount is set to zero for all the customers.


For a particular customer the date on which some transaction is done, previous balance amount is
added with the transaction amount of that day to calculate the Balance amount on that day.
The day on which no transaction has been done, Balance Amount holds its previous value.
Although cube contains the data only for the dates on which transaction is done, report gives the data
for intermediate dates also on which no transaction has been done.

7. Understanding Validity Table


We know that whenever an InfoCube is created by the user, system creates two tables to store
the value of key figure. These tables are called F fact table and E Fact Table. Data are in F fact
table before compression and data moves to E fact table after data compression. In case of Noncumulative key figure system creates one extra table called the validity table or L table. Field of this
table is defined during creation of non-cumulative InfoCube.
Following screenshot shows that one additional table called the L table /BIC/LZ8_NCKC1 that has
been created by the system.

Generated by Jive on 2015-08-10+02:00


9

Concept of Non-cumulative Key Figure in SAP BI

L table contains the SID of first transaction date and last transaction date as range of validity area for
a particular customer.

T-code RSDV can be used to display and edit Validity Slice as shown in the screenshot below.

Generated by Jive on 2015-08-10+02:00


10

Concept of Non-cumulative Key Figure in SAP BI

Validity Slice contains the validity range as first transaction date and last transaction date for a
particular customer.

8. Sample File for the explained scenario Attached file contains the sample data and BI Objects that have
been used for modeling and data loading for this scenario. Readers can use this file to create a sample
modeling and data loading in the sandbox system to learn concept of Non-Cumulative Key Figure.

9. Related Content
Reference 1
http://help.sap.com/
Reference 2
http://www.sdn.sap.com/irj/sdn
Reference 3
service.sap.com

Generated by Jive on 2015-08-10+02:00


11

You might also like