You are on page 1of 17

Calculating the Difference

between Created Date and


Changed Date in BW/BI Reports

Applies to:
SAP NetWeaver Business Warehouse (Formerly BI), Will also work on SAP BI 3.5. For more information,
visit the EDW homepage.

Summary
This article describes how to Calculate the Difference between Created date and Changed date in BW or BI
Reports.

Author: Surendra Kumar Reddy Koduru


Company: ITC Infotech India Ltd. (Bangalore/INDIA)
Created on: 23 June 2011

Author Bio
Surendra Kumar Reddy Koduru is a SAP BI Lead Consultant currently working with ITC Infotech
India Ltd (Bangalore/INDIA). He has got rich experience and worked on various BW/BI
Implementation/Support Projects and he is the author for various Articles and Blogs (SAP-BW/BI) in
SAP Community Network.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 1
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Table of Contents
Introduction / Requirement: ................................................................................................................................ 3
How to Achieve: .............................................................................................................................................. 3
Creating Variable on Created Date: ................................................................................................................ 3
All Tabs of the Variable: .................................................................................................................................. 7
Creating Variable on Changed Date: .............................................................................................................. 9
Creating Formulas with both Variables in report: .......................................................................................... 13
Save and Execute the report: ....................................................................................................................... 14
Related Content ................................................................................................................................................ 15
Disclaimer and Liability Notice .......................................................................................................................... 17

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 2
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Introduction / Requirement:
This article describes how to Calculate the Difference between Created date and Changed date in BW or BI
Reports, this is useful whenever you want to find out the delay in days between Created and Changed dates.

How to Achieve:
Using Formula Variables with replacement path in BEx reports we can achieve it. Create one formula
variable with replacement path on Created Date Character and another formula variable with replacement
path on Changed Date, then create a formula and just do simple subtraction in report.

Creating Variable on Created Date:

This formula is just Dummy formula to create a formula variable we need to create a formula first then in that
we can create a formula variable, that is the reason I’m creating the formula, and after creating the both
formula variables we will edit the same formula and then create actual calculations in that formula.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 3
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 4
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Select the Edit option and then follow the below steps.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 5
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

In General tab, give Technical name, Type of Variable is by default Formula, Processing By you must select
Replacement Path finally you need to select the Reference Characteristic, i.e. from which Field you are
replacing the value into this Variable, in our case Create Date.

In Currency/Unit tab, select Dimensions is Date, because we are doing Date calculations.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 6
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

All Tabs of the Variable:


See all the below screen, which will give the complete properties of the Variable, it is easy for you to create
your self.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 7
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 8
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Creating Variable on Changed Date:


Follow all the above steps i.e. similar to Created Date Variable. So I’m giving final screen of Changed Date
Variable.
You just see the below screens, you can get the variable details

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 9
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 10
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 11
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

See the both variables in below Screen.

We will create a formula and in that we will subtract Changed Date with Created Date then we will get
difference between two Dates.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 12
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Creating Formulas with both Variables in report:

We are created a Formula in report and then open in Edit mode and create the formula like below.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 13
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Save and Execute the report:

See the above result; it calculated the correct number of day’s difference between Changed and Crated
Dates.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 14
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Related Content
For all Articles and Blogs by Surendra Kumar Reddy, Please visit this URL
Using Customer Exit Variables in BW Reports Part - 1
Using Customer Exit Variables in BW Reports Part - 2
Using Customer Exit Variables in BW Reports Part - 3
Using Customer Exit Variables in BW Reports Part - 4
Using Customer Exit Variables in BW Reports Part - 5
Using Customer Exit Variables in BW Reports Part - 6
Using Customer Exit Variables in BW Reports: Part - 8
Using Customer Exit Variables in BW Reports: Part - 9
Using Customer Exit Variables in BW Reports: Part - 10
Using Customer Exit Variables in BW Reports: Part - 11
Using Customer Exit Variables in BW Reports: Part - 12
Using Customer Exit Variables in BW Reports: Part - 13
Using Customer Exit Variables in BW Reports: Part - 14
Using Customer Exit Variables in BW Reports: Part - 15
Using Customer Exit Variables in BW Reports: Part - 16
Using Customer Exit Variables in BW Reports: Part - 17
Using Customer Exit Variables in BW Reports: Part - 18
Inventory Management (0IC_C03) Part - 1
Inventory Management (0IC_C03) Part - 2
Inventory Management (0IC_C03) Part - 3
To Check the Files/Reports in Application Server and trigger mail alerts
Calculating the Ageing of the Materials
Using Selective Deletion in Process Chains
Triggering the Process Chains at Particular Date using Events
Analysis Process Designer (APD) Part - 1
Analysis Process Designer (APD) Part - 2
Analysis Process Designer (APD): Part - 3
Open Hub Destination: Part 1
Open Hub Destination: Part 2
InfoSpoke Part 1
InfoSpoke Part 2
Using Rule Group in SAP-BI Part - 1
Data Flow from LBWQ/SMQ1 to RSA7 in ECC and Delta Extraction in BI

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 15
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Checking the Data using Extractor Checker (RSA3) in ECC Delta Repeat Delta etc...
Data Flow from LBWQ SMQ1 to RSA7 in ECC (Records Comparison)
How to Correct Routines in Transformations
For more information, visit the EDW homepage.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 16
Calculating the Difference between Created Date and Changed Date in BW/BI Reports

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not
supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,
and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or
code sample, including any liability resulting from incompatibility between the content within this document and the materials and
services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this
document.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 17

You might also like