Entering content frame

Procedure documentation Defining Calculated Key Figures Locate the document in its SAP Library structure

Use

You can recalculate the key figures of an InfoProvider for reuse in the Query Designer using formulas. 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

  1. In the InfoProvider objects display frame, select Key Figure and from the context menu (right-mouse click), choose New Calculated Key Figure.

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

The New Calculated Key Figure dialog box appears.

The upper part of the screen contains a text field in which you enter a description of the calculated key figure.

Note

You can use text variables in the description.

Beneath this is the input field for the formula that you want to use to calculated the key figure. The bottom left screen area contains all of the operands available for the formula definition. These are:

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

Between the operands and the functions, the symbols for the basic arithmetic operations are displayed. To the right of the functions, there is a number block.

Proceed as follows to define a formula:

Note

You can also enter digits, parentheses and basic arithmetical operations using the keyboard.

  1. Define your formula using the available operands and operators.

Note

If, when defining a formula, you want to use a variable that is not contained in the operands, you must first create the variable. Highlight the Formula Variable entry and using the right mouse button on the context menu, choose New Formula. You reach the variable wizard that takes you through a step-by-step process for defining a new variable.

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

Caution

Note that when you execute a query, the key figures are always calculated as the same unit. That is, a formula is semantically incorrect if, for example, a currency unit (for example, USD) is added to a weight unit (for example, kg). If you want to calculate values regardless of the unit, use the function Value Without Dimension (Without Units). See Data Functions.

  1. Check the formula definition and choose Formula Syntax Check This graphic is explained in the accompanying text.
  2. Note

    The Formula Syntax Check This graphic is explained in the accompanying text function checks only the correctness of the syntax in the formula. It does not check whether the formula makes sense semantically, for example, if it contains the same units. You make semantic checks using the function Check Query (see Functions of the BEx Query Designer).

  3. Enter a description for the calculated key figure..
  4. 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 are effective in all queries that use this calculated key figure.

Note

You can see where the calculated key figure is used. Choose Where-used List from the context menu (right mouse click).

  1. In the InfoProvider objects display frame, select the calculated key figure and, from the context menu (right-mouse click), choose Edit.
  2. Make the required changes.
  3. Choose OK.

Determining Properties for the Calculated Key Figure

  1. In the left display frame for InfoProvider objects, select the calculated key figure and, from the context menu, choose Properties.
  2. Make the required settings for the description, display, number format, currency translation, local calculations and the aggregation behavior of the calculated key figure. See Calculated key figure properties

Result

You have defined a calculated key figure for reuse.You can now 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&Drop. The calculated key figure is not an actual element in this query, but a placeholder referenced to the calculated key figure in the InfoProvider.

 

 

Leaving content frame