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 screen area, select the Key Figures entry and from the context menu (secondary mouse button 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 entry New Calculated Key Figure is inserted and the properties for the calculated key figure are displayed in the Properties screen area.

       2.      Select the New Calculated Key Figure entry and, from the context menu (secondary mouse button), choose Edit.

The Calculated Key Figure dialog box appears.

Make the basic settings on the General tab page.

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.

Next to that, you can enter a technical name in the Technical Name field.

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 defining the formula. These are:

-         The basic key figures, calculated key figures and restricted key figures from the relevant InfoProvider.

-         All form 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, you see the symbols for the basic arithmetic operations. To the right there is a number block.

Proceed as follows to define a formula:

¡        Choose the required operands and insert them in the Detail View field by double-clicking or by using Drag&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&Drop.

¡        Select the numerical values for the formula by clicking on the number block.

Note

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

       3.      Define your formula using the available operands and operators. With each step, the system checks the syntactic correctness of the formula. If the formula is not yet complete and syntactically correct, the erroneous point is underlined 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 the Query Designer Toolbar.

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, from the context menu, choose New Formula. You reach the variable wizard. This 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 variables editor appears.

Caution

Note that when you execute a query, the key figures are always calculated as the same unit.  A formula is semantically incorrect, for example, when 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 function Value Without Dimension (Without Units). See Data Functions.

       4.      Enter a description for the calculated key figure.

       5.      Make any necessary settings for the properties of the calculated key figure in the other tab pages. See Selection/Formula Properties

       6.      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 (secondary mouse click).

...

       1.      In the InfoProvider screen area, select the calculated key figure and, from the context menu (secondary mouse button), choose Edit.

       2.      Make the required changes to the formula definition or to the associated tab page in the properties.

       3.      Choose OK.

Determining Properties for the Calculated Key Figure

...

       1.      Select the calculated key figure. The Properties screen area is displayed in the properties dialog box.

       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 Selection/Formula 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