Professional Documents
Culture Documents
Using Nested Exception Aggregation in BEx Reports - Scenario
Using Nested Exception Aggregation in BEx Reports - Scenario
Applies to:
SAP BW 3.x & SAP BI Net Weaver 2004s. For more information, visit the Business Intelligence homepage.
Summary
The Objective of this article is to explain the necessity of Nested Exception Aggregation in BEx reports with a
scenario.
Author: KVS VaraPrasad
Company: Cognizant Technology Solutions (India).
Created on: 25 October 2011
Author Bio
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 1
Using Nested Exception Aggregation in BEx Reports- Scenario
Table of Contents
SAP BW 3.x & SAP BI Net Weaver 2004s. For more information, visit the Business Intelligence homepage. . 1
Summary............................................................................................................................................................. 1
Author Bio ........................................................................................................................................................... 1
Purpose:.............................................................................................................................................................. 3
Report Requirements:......................................................................................................................................... 3
Counting total number of deliveries: ................................................................................................................... 4
How to create IF then ELSE Conditions in Calculated Key Figures: ................................................................ 12
Counting On-time Deliveries: ............................................................................................................................ 12
Counting Late Deliveries:.................................................................................................................................. 14
Counting Early Deliveries: ................................................................................................................................ 15
Nested Exception Aggregation: ........................................................................................................................ 17
Nested Exception Aggregation on On-time Deliveries CKF: ............................................................................ 18
Nested Exception Aggregation on Deliveries Late CKF: .................................................................................. 19
Nested Exception Aggregation on Deliveries Early CKF: ................................................................................. 20
Related Content ................................................................................................................................................ 22
Disclaimer and Liability Notice .......................................................................................................................... 23
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 2
Using Nested Exception Aggregation in BEx Reports- Scenario
Purpose:
This article addresses the requirement of Nested Exception aggregation in BW/BI Reports; In this article I’m
going to explain the following list:
How to use the formula variables with replacement path as processing type.
How to use IF ELSE condition in the calculated Keyfigures.
How to create and use Nested Exception Aggregation.
Report Requirements:
In some sales based reports, Users wants to see the Total number of deliveries, On-time deliveries, early
deliveries and Late Deliveries for particular time period.
To display the data as per above requirements we have to create Calculated Keyfigures to count the delivery
numbers based on Actual Delivery Date and Requested Delivery Date of Delivery number.
On-time Delivery: An On-time Delivery is a delivery number whose Actual Delivery Date is
equal to Requested Delivery Date.
Late Delivery: A Late Delivery is a delivery number whose Actual Delivery Date is greater than
Requested Delivery Date.
Early Delivery: An Early Delivery is a delivery number whose Actual Delivery Date is less than
Requested Delivery Date.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 3
Using Nested Exception Aggregation in BEx Reports- Scenario
Step 2: Give the Description and technical names as Number of Deliveries and CKF_NO_DEL_1
respectively and create a new Formula Variable to hold the Delivery numbers.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 4
Using Nested Exception Aggregation in BEx Reports- Scenario
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 5
Using Nested Exception Aggregation in BEx Reports- Scenario
This formula is not ready for input (Don’t Check Variable is Ready for Input)
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 6
Using Nested Exception Aggregation in BEx Reports- Scenario
Step 4: Drag and drop the Delivery Number (ZVAR_DEL_NUMB) formula variable into the Detail view of
Number of Deliveries (CKF_NO_DEL_1) Calculated Key Figure.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 7
Using Nested Exception Aggregation in BEx Reports- Scenario
In the Replacement Path tab, select the Replace Variable with attribute as InfoObject and replace with Key
value. The Off set values for date field starts with 0(Zero) and the length should be 8.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 8
Using Nested Exception Aggregation in BEx Reports- Scenario
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 9
Using Nested Exception Aggregation in BEx Reports- Scenario
Similarly create another formula variable with Requested Delivery date as reference characteristic:
Description: Requested Delivery Date Formula
Technical Name: VAR_REQ_DEL_DATE
Type of Variable: Formula
Processing by: Replacement Path
Reference Characteristic: Requested Delivery Date (0DSDEL_DATE)
In the Replacement Path tab, select the Replacement Variable with attribute as InfoObject and Replaced
with Key value. The Off set values for date field starts with 0(Zero) and the length should be 8.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 10
Using Nested Exception Aggregation in BEx Reports- Scenario
Now we can compare Acutal Delivery date with Requested Delivery date value by using logical operators
example: = , < ,>, <=,>=…..
Date Difference = Actual Delivery Date Formula (VAR_ACT_DEL_DATE_FORM) - Requested Delivery Date
Formula (VAR_REQ_DEL_DATE).
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 11
Using Nested Exception Aggregation in BEx Reports- Scenario
We can write IF then Else statement for different comparisons in Calculated KeyFigure / Formula.
Example: (A ==B)*C + (A>B) *D + (A<B) * E Statements gives different results for different values of A & B.
Case 1:
IF A == B is True
The Statement becomes (1) * C + (0) * D + (0) * E Result is C.
Case 2:
IF A > B is True
Then the statement becomes (0) * C + (1) * D + (0) * E Result is D
Case 3:
If A < B is True
Then the statement becomes (0) * C + (0) * D + (1) * E Result is E.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 12
Using Nested Exception Aggregation in BEx Reports- Scenario
Set the Exception Aggregation value to TOTAL and Reference Characteristic Requested Delivery date.
Exception Aggregation as „Total‟: As the name signifies, this function is used to aggregate the result of a
key figure in a different manner than standard OLAP functionality. It works same as Standard Exception
Aggregation but summarized keyfigure with respect to the Reference Characteristic.
Similarly create Late deliveries and Early deliveries calculated keyfigures to count Late and Early deliveries.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 13
Using Nested Exception Aggregation in BEx Reports- Scenario
Set the Exception Aggregation value to TOTAL and Reference Characteristic Requested Delivery date
(0DSDEL_DATE)
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 14
Using Nested Exception Aggregation in BEx Reports- Scenario
Set the Exception Aggregation value to TOTAL and Reference Characteristic Requested Delivery date
(0DSDEL_DATE)
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 15
Using Nested Exception Aggregation in BEx Reports- Scenario
Report Result:
Place Actual Delivery date and Requested Delivery dates in the columns of BEx designer of the report for
detail analysis of above error, then the report result will be as follows:
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 16
Using Nested Exception Aggregation in BEx Reports- Scenario
Report result:
As per above screenshot, we can understand that On-time, Delivery Late and Delivery Early are not
summarized at Actual, Requested Delivery date levels. In order to get summarized result we have to use
TOTAL as an Exception Aggregation type with respect to dates. Here we need nested exception aggregation
to get correct results. i.e first we have to create one Calculated Keyfigure with TOTAL Exception aggregate
with reference to Requested Delviery date and then create another Calculated Key Figure/Formula and call
the earlier CKF(with Requested Delivery date as reference cahracteristic) into this and set the TOTAL
Exception aggregation with reference characteristic Actual Delivery Date.
As per the result, the deliveries are not aggregated along with Actual Delivery Date (‘X’ value in result
columns). To avoid this situation we need one more level of Calculated Key Figures/Formula with Exception
Aggreateion on current Calculated KeyFigures.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 17
Using Nested Exception Aggregation in BEx Reports- Scenario
Set the Exception Aggregation to Total and Actual Delivery date (0ACT_DL_DTE) as Reference
Characteristic:
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 18
Using Nested Exception Aggregation in BEx Reports- Scenario
Set the Exception Aggregation to Total and Actual Delivery date (0ACT_DL_DTE) as Reference
Characteristic
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 19
Using Nested Exception Aggregation in BEx Reports- Scenario
Set the Exception Aggregation to Total and Actual Delivery date (0ACT_DL_DTE) as Reference
Characteristic
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 20
Using Nested Exception Aggregation in BEx Reports- Scenario
Drag and drop the Deliveries On-Time (CKF_DEL_ON_TIME_3), Late Deliveries (CKF_LATE_DEL_5) and
Early Deliveries (CKF_EARLY_DEL_7) Calculated Key Figures into the Rows and Company code into the
Coulumns.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 21
Using Nested Exception Aggregation in BEx Reports- Scenario
Related Content
http://help.sap.com/saphelp_nw70/helpdata/en/75/21054da1392649948e5b94e4fc4bce/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/03/6ba03cc24efd1de10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/6f/56853c08c7aa11e10000000a11405a/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/ca/5f9ac61a205a459d0e7ef313d10321/content.htm
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 22
Using Nested Exception Aggregation in BEx Reports- Scenario
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 23