Show TOC
# Defining Calculated Key Figures

Use

In Query Designer, you use formulas to recalculate the key figures in an InfoProvider so that you can reuse them. Calculated key figures consist of formula definitions containing basic key figures, restricted key figures, or precalculated key figures.

Procedure

Defining a New Calculated Key Figure

- In the InfoProvider screen area, select Key Figures and choose New Calculated Key Figure from the context menu.
If a calculated key figure has already been defined for this InfoProvider, you can select the Calculated Key Figures entry and choose New Calculated Key Figure from the context menu.

The system adds New Calculated Key Figure, and the properties for the calculated key figure are displayed in the Properties screen area.

- Select New Calculated Key Figure and choose Edit from the context menu.
The Calculated Key Figure dialog box appears.

NoteYou can also call the Change Calculated Key Figure dialog box from the Properties screen area by choosing the Edit pushbutton.

You make the basic settings on the General tab page.

The upper part of the screen contains a text field, where you can enter a description for the calculated key figure.

NoteYou can usetext variables in the description.

You can also enter a technical name in the Technical Name field.

Below this is the input field for the formula that you want to use to calculate the key figure. The area to the bottom left contains all the operands available for defining the formula. These are:

- The basic key figures, calculated key figures and restricted key figures from the relevant InfoProvider
- All formula variables

On the right side of the screen, you see the functions that are available as operators:

- Basic functions
- Percentage functions
- Data functions
- Mathematical functions
- Trigonometric functions
- Boolean operators

Above these two areas, the symbols for basic arithmetical operations are displayed. To the right, there is a numeric pad.

To define a formula, proceed as follows:

- Choose the required operands and insert them in the Detail View field by double-clicking or by using drag and drop.
- Choose the calculation functions you want to use by either clicking on the symbols for the basic arithmetic operations, double-clicking on the functions, or using drag and drop.
- Select the numerical values for the formula by clicking the numeric pad.Note
You can also enter digits, parentheses and basic arithmetical operations using the keyboard.

- Define your formula using the operands and operators provided. With each step, the system checks the syntactic correctness of the formula. If the formula is incomplete or syntactically incorrect, the system underlines the error in red.
The system does not check whether the formula makes sense semantically, for example, if it contains the same units. Semantic checks are performed with the Check Query function, which you can call in theQuery Designer Toolbar.

NoteIf you want to use a variable that is not contained in the operands while defining a formula, you first need to create the variable. Highlight the Formula Variable entry and choose New Formula from the context menu. The Variables Wizard now appears. This guides you step-by-step through the process for defining a new variable.

If you want to change a formula variable, select the variable and choose Edit from the context menu. The Variables Editor appears.

CautionNote that when you execute a query, the key figures are always calculated as the same unit. A formula is semantically incorrect, for example, if you add a currency unit (such as EUR) with a weight unit (such as kg). If you want to calculate values regardless of the unit, use the Value Without Dimension (Without Units) function . SeeData Functions.

- Enter a description for the calculated key figure.
- On the other tab pages, make any required settings for the properties of the calculated key figure. SeeSelection/Formula/Cell Properties.
- Choose OK. The new calculated key figure is defined for the InfoProvider.

Editing Calculated Key Figures

Caution

Note that when you change a calculated key figure, these changes take effect in all queries that use the calculated key figure.

Note

You can see where the calculated key figure is used. Choose Where-used List on the calculated key figure in the context menu.

- In the InfoProvider screen area, select the calculated key figure and choose Edit from the context menu.

You can also call the Change Calculated Key Figure dialog box from the Properties screen area by choosing the Edit pushbutton.

- Make the required changes to the formula definition or in the properties on the corresponding tab page.
- Choose OK.

Defining Properties for the Calculated Key Figure

- Select the calculated key figure. The properties dialog box is displayed in the Properties screen area.
- Make the required settings for the description, display, number format, currency translation, local calculations and aggregation behavior of the calculated key figure. SeeSelection/Formula/Cell Properties.

Result

You have defined a calculated key figure for reuse. You can use this calculated key figure in all queries based on this InfoProvider by moving the key figure into the rows or columns of the query using drag and drop. The calculated key figure is not an actual element of this query, but a placeholder that references the calculated key figure in the InfoProvider.