Entering content frame

Function documentation Calculated Key Figure Properties Locate the document in its SAP Library structure

Use

In the Key Figure Properties dialog box, you can make settings for a range of functions for a calculated key figure.

Features

You can select the following functions in the Selection/Formula Properties dialog box:

·        Description

·        Layout

·        Number Display

·        Calculations

·        Currency Translation

For more information about these functions, see Selection/Formula Properties.

In addition, you can select the following functions in the Key Figure Properties dialog box.

Last Changed

This is where you can see details of the owner and person who last changed the structure, as well as the corresponding data and time that the key figure was changed. This information can be useful since calculated key figures deal with reusable objects.

Aggregation Behavior

In the Key Figure Properties dialog box, choose Enhance >>. The Aggregation Behavior field is added to the dialog box.

You can make settings for the aggregation of the calculated key figure and the time that the calculated key figure is calculated here. Depending on the complexity of the formula, you can select various settings in the enhanced properties of the calculated key figure. The following types of calculated key figures with the corresponding formula complexity are available:

·        Assignment

A formula has the complexity Assignment if it has the form =operand (for example, =invoicedquantity), where the operand consists of a basic key figure.

Formulas with the complexity Assignment are used to change the aggregation behavior of the key figure (for example, the key figure is aggregated to the total, but you want to have the average).

The Aggregation field is visible but not ready-for-input. The Exception Aggregation field is visible and ready-for-input. The standard value for both of these fields is made up of the values from the corresponding fields in the source key figure. You can change the exception aggregation.

You can select the following settings in the Exception Aggregation field.

-         Summation

-         Maximum

-         Minimum

-         Exception, if more than one record occurs

-         Exception, if more than one value occurs

-         Exception, if more than one value <> 0 occurs

-         Average of all values

-         Average of all values <> 0

-         Average for calendar days

-         Average for working days

-         Count all values

-         Count all values <> 0

-         First value

-         Last value

-         Standard deviation

-         Variance

You can find additional information about the setting options for exception aggregation in the documentation for InfoObject maintenance under Structure linkTab Page: Aggregation.

If the fields Aggregation and Exception Aggregation have the same setting, the field Reference Characteristic for Exception Aggregation is empty and not ready-for-input.

If the fields Aggregation and Exception Aggregation have different settings, you have to specify the reference characteristic for the exception aggregation.

·        Simple

A formula has the complexity Simple if it is made up exclusively of operands with the same aggregation, where the operands basic key figures, constants or calculated key figures can have the complexity Simple (for example, profit=sales minus revenue).

In the Time of Calculation field, you can choose whether the formula is calculated After Aggregation or Before Aggregation.

Recommendation

If you choose to calculate the formula before aggregation, this usually leads to bad performance as a large amount of data (single records) has to be calculated. Often in formula calculations, the single record information for only one or two specific characteristics is required and the rest of the InfoProvider data can be aggregated

Therefore, we recommend that you use a formula variable that is replaced with the attribute Reference to Characteristic (Constant 1). Using this attribute, the reference to such a characteristic, which is not to be aggregated, can be created. The attribute Reference to Characteristic (Constant 1) is available for each characteristic.

If you use such a variable in a formula (instead of in a calculated key figure), it is replaced with a 1 but this has no effect on the aggregation behavior since formulas are always calculated after aggregation.

For more information about formula variables and replacing them with attribute values, see Replacement Path: Replacement with a Characteristic Value and Calculating with Variables for Processing Type “Replacemnt Path”.

Example

Example of replacement with a constant attribute:

There are purchase orders in the InfoCube on a document line level with the key figures Quantity and Price (for each document line). You want to see the sales order value of a purchase order. To do this you have to calculate the quantity x price for each document line.

If you define a calculated key figure Quantity x Price x &REFVAR&, where &REFVAR& represents the reference to the characteristic Purchase Order, the OLAP processor can aggregate all other dimensions first of all (for example, customer, period) and then make the calculation for each purchase order. This means that performance is considerably improved than when single records are calculated first and then aggregated.

·        Complex

All other types of formula have the complexity Complex and are always calculated after aggregation.

The different options for aggregation settings are not ready-for-input and the time of calculation is set at After Aggregation.

Background documentation

Most formulas are complex and are therefore calculated after aggregation.

Activities

In the InfoProvider objects dialog box, select a calculated key figure and from the context menu, choose Properties. You reach the Calculated Key Figure Properties dialog box.

 

 

Leaving content frame