!--a11y-->
Defining Formulas 
You can recalculate the key figures in a structure using a formula. You can include basic key figures, restricted key figures, and calculated key figure in the formula definition.
...
1. If the query does not yet have a key figure structure, create a New Structure in the Rows or Columns of the Query Designer by highlighting the row or column directory using the right mouse button and selecting New Structure from the context menu.
2. If the structure does not yet contain any key figures, use Drag&Drop to transfer a (basic) key figure of the InfoProvider into the directory of the new structure.
3. Select the structure directory, and choose New Formula. The formula definition screen appears.
There is a text field, in which you enter a description of the formula in the upper part of the screen.

You can use text variables in the description.
The formula entry field is below the text fields. The bottom left screen area contains all of the operands available for defining the formula. These are:
- The structure elements that you have already defined for the structure
- The cells that you have defined as exception cells
- All form variables
On the right side of the screen, you see the functions that are available as operators:
- Basic functions
- Mathematical functions
- Trigonometric functions
The symbols for the basic arithmetic operations are displayed between the operands and the functions. There is a number block to the right of the functions.
Proceed as follows to define a formula:
¡ Choose the operands you want to use, and insert them in the entry field for the formula 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.

You can also enter digits, parentheses and basic arithmetical operations using the keyboard.
4. Define your formula using the available operands and operators.

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 variable editor appears.

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.
5.
Check the formula definition and choose
Formula Syntax Check
.

The Formula Syntax Check
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).
6. Enter a description for the formula column.
7. Choose OK. The new formula is defined in the structure.
...
1. Highlight the formula in the structure and, from the context menu, choose Edit.
2. Make the required changes.
3. Choose OK.
...
1. Highlight the formula in the structure and, from the context menu, choose Properties.
2. Make the required settings for the technical name, description, display, number format, calculations, and formula collision in the formula. See Selection/Formula Properties
See also:
Technical Notes about the Formula Operators