Aggregation of Key Figures
SAP COMMUNITY NETWORK SDN -
- boc.sap.com |
- uac.sap.com © 2011 SAP AG 3
To provide flexibility with calculated query key figure values and meet the demands of a user environment,you might want to calculate values in queries using different types of aggregation.BW uses the Before Aggregation and After Aggregation settings in query processing. They do not relate toaggregates that improve performance. The Before Aggregation setting calculates key figures differently thanthe After Aggregation setting in BEx Analyzer.The document describes how they operate and where to find them in the system.
To calculate the value of key figures, the data from the InfoProvider has to be aggregated at the detail levelfor the query. It is possible that formulas also have to be calculated. In this case, several characteristicshave to be aggregated. For each key figure, one selected characteristic can be aggregated with another rule.
The OLAP engine in the BW proceeds as follows:
Standard aggregation is executed first. Possible types if aggregation are summation (SUM),minimum (MIN), and maximum (MAX). Minimum and maximum can be set, for example, for date keyfigures.
The aggregation of a selected characteristic takes place after the standard aggregation (exceptionaggregation). Possible exception aggregations available are average, counter, first value, last value,minimum, maximum, no aggregation, standard deviation, summation and variance. Cases whereexception aggregation would be applied include, for example, storage non-cumulative that can notbe totaled by time, or counters that count the number of characteristics for a particular characteristic.
Aggregation by currency and units is executed last. If two figures are aggregated unequally with
different currencies or units, the system marks this with „*‟.
Before / After Aggregation
The BW 3.x system can perform two different types of calculated key figure aggregation:
After Aggregation.For example, a query might display a total price variance report. This report would calculate differently ifcalculated before aggregation versus after aggregation.When BW calculates the report before aggregation, it calculates each variance individually on each line andthen aggregates them together to form a variance.If BW calculates after aggregation, it adds the total price values and then determines the variance.Depending on the formula, these two approaches can give widely different key figure results.Developers can set the type of aggregation individually on each calculated key figure. However, the systeminitially sets all key figures to After Aggregation by default. Using the Before Aggregation setting, you canarrive at a calculation that you may otherwise not be able to perform. However, it may negatively affect your