Show TOC

Replacement from Characteristic ValueLocate this document in the navigation structure

Text and formula variables with the processing type Replacement Path can be replaced with a corresponding characteristic value. The value of a formula variable has to be a number. The value of a text variable has to be a text.

Variables Wizard

On the Variable - Replacement Rule dialog in the second step of the variables wizard, you specify that the variable derives its value from an InfoObject.

Variables Editor

In the variables editor under Replacement Rule, the system indicates that a variable serves as the source for replacing the variable. This replacement rule cannot be modified.

You can still change the object that you want to use for the replacement however. Choose Browse. A dialog box appears where you can select a different object.

The following properties are still modifiable:

  • Replacment With: Choose where the value of the variable will be determined from.
    • Key The value of the variable is replaced with the characteristic key.

    • External Characteristic (of the key) The value of the variable is replaced with an external value of the characteristic (external/internal conversion).

    • Name The value of the variable is replaced with the name of the characteristic.

      Caution

      Note that formula variables have to contain numbers in their names so that the formula variable represents a number after replacement.

    • [1ATTRREF] Characteristic Reference (Constant 1) - this setting is only available for formula variables.

    • [0SIGNCH] Sign Change: The variable value is replaced with a value of a hierarchy attribute. You need this setting for sign reversal with hierarchy nodes. This is only available for formula variables.
  • After Aggregation (replacement of the variable after aggregation): This option is set by default. If you deselect this, the variable will be replaced before aggregation. It is not always possible to change this however. Replacement of the variable in the case of [1ATTRREF] Characteristic Reference (Constant 1) always takes place before aggregation. In the case of Name and [0SIGNCH] Sign Change, it takes place after aggregation.

  • Interpret Result As Boolean Value (True=1; False=0) This function is only available for formula variables. If you select this setting, the formula variable will not be replaced with a value (the key value for example) but merely specifies the existence of a value.

    • The value of the variable is 0 when the value to be replaced is a string with only blank spaces or a zero.
    • The value of the variable is 1 when the value to be replaced is a string with characters that are not blank spaces or a number does not equal 0.
      Example

      You want to calculate paid amounts only.

      Create a formula variable with processing type Replacement Path and replacement rule InfoObject in order to replace the variable with the value of an attribute. Choose the attribute Paid. (The master data attribute Paid shows open invoices with a blank space " " and paid invoices with the value "X".) Select Interpret Result As Boolean Value (True=1; False=0).

      You then get a 0 for blanks and a 1 for the value "X". By a multiplication with this kind of formula variable, all unpaid amounts in the query are then omitted. You have met your objective of only having paid amounts.

Under Details, you can make the following settings:

  • If Interval Use:

    • From Value

    • To Value

    • Difference

    If the replacement value found is an interval, you can use this setting to specify whether the lower interval limit (from value) or the upper interval limit (to value) is used as the replacement value.

    For formula variables, you can also choose the interval difference as the replacement value. Using this setting, you can easily calculate the difference of period boundaries. The interval difference is obtained by subtracting the From value from the To value and then adding 1.

    Example

    The period January to March therefore has a 3 (To value 3 minus From value 1 plus1).

  • Offset Settings:

    • Offset Start

    • Offset Length:

    You use this function to specify the start and length of the text output.

    Example

    You want to create a text variable for the fiscal year.

    Create a text variable with processing type Replacement Path and replacement rule InfoObject in order to replace the variable with the value of an attribute. Under Replacement with, choose replacement by key and define the offset start at value 2 and the offset length as 2.

    The fiscal year contains four digits. The output of the value begins after the second digit and shows two digits. In the query, the text variable for fiscal year 2005 is therefore replaced with the value "05".