SAP BW Non Cumulative Key Figures

Embed Size (px)

Citation preview

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    1/11

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

    1

    Concept of Non-cumulative Key Figure inSAP 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 Non-

    cumulative key figure with non-cumulative value change has been taken to explain the concept.

     

    Author: Prakash Kumar Sahu

    Company: Tata Technologies Limited (Pune/India)

    Created on: 12 March 2012

    Author Bio

    Prakash Kumar Sahu is a SAP BI consultant with more than 3 years of SAP BI/BW experience and currentlyworking 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 Analysis7. Understanding Validity Table

    8. Sample File for the explained scenario

    9. Related Content

    http://scn.sap.com/servlet/JiveServlet/showImage/81241/Pic1.png

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    2/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    2

    1. IntroductionThis article explains step by step process about how non-cumulative key figure works in BW. Example of Non-

    cumulative 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 non-

    cumulative 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 types-

    1. 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.

    http://scn.sap.com/servlet/JiveServlet/showImage/81275/pic2.png

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    3/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    3

    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 ScenarioLet 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 balanceamount 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.

    http://scn.sap.com/servlet/JiveServlet/showImage/81277/4.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/81276/pic3.png

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    4/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    4

    4. Modeling - Creating Non-CumulativeInfoCube

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

    cumulative InfoCube.

    http://scn.sap.com/servlet/JiveServlet/showImage/81281/5.png

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    5/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    5

    • When we insert non-cumulative key figure Z8_BAL then cumulative key figure Z8_TRAMT isautomatically 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. Mostdetailed time characteristics are automatically selected by the system.

     

    http://scn.sap.com/servlet/JiveServlet/showImage/81282/6.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/81283/7a.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/81282/6.png

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    6/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    6

     

    5. Modeling - Creating Transformation

    • Only cumulative key figures are available for transformation.

      Create the mapping as below between datasource and InfoCube.

    http://scn.sap.com/servlet/JiveServlet/showImage/81284/7b.png

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    7/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    7

    • Transaction amount in target is mapped with Transaction amount and credit/debit insource. Credited amount is stored as +ve value and debited amount is stored as –vevalue 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.

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    8/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    8

    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

    been done i.e. 1st

    , 2nd

    , 3rd

    , and 9th

    , 12th

     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 inInfoCube(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 TransactionAmount (cumulative).

    Report Output

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    9/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    9

    • 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 storethe value of key figure. These tables are called F fact table and E Fact Table. Data are in F facttable before compression and data moves to E fact table after data compression. In case of Non-

    cumulative key figure system creates one extra table called the validity table or L table. Field of thistable is defined during creation of non-cumulative InfoCube.

    • Following screenshot shows that one additional table called the L table /BIC/LZ8_NCKC1 that hasbeen created by the system.

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    10/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    10

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

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

    http://scn.sap.com/servlet/JiveServlet/showImage/81342/14.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/81341/13.png

  • 8/20/2019 SAP BW Non Cumulative Key Figures

    11/11

    Concept of Non-cumulative Key Figure in SAP BI

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

    11

    • Validity Slice contains the validity range as first transaction date and last transaction date for aparticular 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 samplemodeling 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 3service.sap.com

    http://service.sap.com/https://www.sdn.sap.com/irj/sdn/indexhttp://www.sdn.sap.com/irj/sdnhttp://help.sap.com/https://www.sdn.sap.com/irj/sdn/indexhttp://scn.sap.com/servlet/JiveServlet/showImage/81344/16.png