Show TOC

Calculating Variables for Processing Type "Replacement Path"Locate this document in the navigation structure

Use

In formulas it is possible to calculate with the properties or values for a characteristic (such as a key, an external attribute of the key, an attribute value, or a hierarchy attribute). In doing so, the formula is replaced, depending on the cell context.

Features

For example, the basic characteristic Sales Quantity multiplies with the current value for the attribute Price for the characteristic Material. You can reach this with the corresponding, defined formula variable: Processing type Replacement Path, replacement from characteristic Material, replace variable with Attribute Value: Attribute Price.

The replacement of formula variables with the processing type Replacement Path acts differently in calculated key figures and formulas:

  • ·        If you use a formula variable with "Replacement from the Value of an Attribute" in a calculated key figure, then the system automatically adds the drilldown according to the reference characteristic for the attribute. The system then evaluates the variables for each characteristic value for the reference characteristic. Afterwards, the calculated key figure is calculated and, subsequently, all of the other operations are executed, meaning all additional, calculated key figures, aggregations, and formulas. The system only calculates the operators, which are assembled in the calculated key figure itself, before the aggregation using the reference characteristic.
    Caution

    Note that the calculation before the aggregation can impair performance.

  • ·        If you use a formula variable with Replacement from the Value of an Attribute in a formula element, then the variable is only calculated if the reference characteristic is uniquely specified in the respective row, column, or in the filter.
Integration

Replacement from the Value of an Attribute

With formula variables you can set the processing type Replacement from the Value of an Attribute and create a reference to the reference characteristic for the variable. The attribute Reference to Characteristic (Constant 1) is a dummy attribute that is available with each characteristic. It serves to create a reference to the characteristic, by which it does not need to be aggregated. By choosing this attribute, you can influence the aggregation behavior of calculated key figures in a targeted way and can improve performance during calculation.

Example

Example for calculating with variables for process type Replacement from the Value of an Attribute:

Master data table for material

InfoCube

In the example query there are the following objects:

Material Price (V1) is a variable that is replaced by the material price.

K1 = Material Price (V1) is a calculated key figure.

F1 = Material Price (V1) is a formula.

K2 = Material Price (V1) * Sales Quantity is a calculated key figure.

F2 = Material Price (V1) * Sales Quantity is a formula.

K3 = K1 * Sales Quantity is a calculated key figure in which the calculated key figure K1 is further processed.

Query View 1

Query View 2

In the results rows the columns F1 and F2 are not specified, because the material value is not unique. Also, the system cannot calculate F1 and F2 in the overall Query View 2. K1 only aggregates the prices and K3 multiplies these aggregated prices with the aggregated sales quantities. Usually the results from K1 and K3 have no meaning. The calculated key figure K2 delivers the desired results.