!--a11y-->
Aggregation and Calculation Time for
Data 
The collection (aggregation) of data and the calculation of data occur at different times.
With calculated key figures (that is, reusable objects that can be used in several queries), you can define exception aggregations and specify the calculation time. However with local formulas (structural components in only one query), you cannot influence the aggregation forms and the calculation time.
When you execute a query with a calculated key figure and a formula structural component, then the OLAP processor collects the data according to the query definition.
· Key figures are only collected and aggregated for the relevant characteristics, while all others are ignored.
· The calculation of the key figure occurs according to the defined aggregation form before or after the aggregation by means of the OLAP processor.
· The calculation of the local formula occurs basically after the aggregation.
For performance reasons, the evaluation of the calculated key figures occurs partially before and partially after the aggregation of individual data records. In doing so, sums and differences are calculated before the aggregation and all other operators are calculated after the aggregation.
You can make settings in the properties for the calculated key figure so that, for example, a multiplication occurs as an exception before the aggregation. Generally this leads to considerable deterioration of performance, because all affected fact records are read in the OLAP processor and have to be aggregated after the calculation.

Note that the calculation of a calculated key figure with exception aggregation or with the setting Calculation Before Aggregation can significantly impede performance in some cases. This is because aggregates cannot usually be used. For technical reasons, no formula variables are permitted either in calculated key figures that are calculated before the aggregation.
Also note that in a MultiProvider the data records from any InfoProvider can be processed separately. For example, if the formula for the calculated key figure includes key figures that are only available in some of the InfoProviders concerned, then they have the value 0 in the fact records for the other InfoProvider. Analogous to this, non-cumulative InfoCube formulas, which also include non-cumulative and cumulative values, cannot be calculated before the aggregation. Instead of doing this, you need to use the setting Calculation After Aggregation.

We only recommend using the setting Calculation Before Aggregation for test cases.
You can also carry out a calculation before the aggregation by defining a separate key figure and defining the calculation in the update rules. The calculated key figure then exists as a Basic key figure in the InfoCube (and the aggregates).
We also recommend that you use formula variables which are replaced from the attribute Reference to Characteristic (Constant 1). You can find additional information under Properties of the Calculated Key Figure under Aggregational Behavior and under Calculating with Variables for Processing Type “Replacement Path”.
You can adjust the settings for aggregation and for the time of authorization for calculated key figures in the property dialog of the calculated key figure. You can decide whether the calculation is to take place before or after aggregation. For more information, see Calculated Key Figure Properties, under Aggregation Behavior.
You can set exception aggregation in the InfoObject maintenance for the key figure.
See also:
