Go to start of banner

# Formulas with Constants

## Introduction

Please review the notes 1812637 and 1995302 where the behavior of constants in formulas is explained. In the following we try to discuss the content of these notes with the help of simple examples. The main points are:

There are two types of constants:

• vectorial constants: the constant behaves like a (basic) key figure; restrictions are possible, in general this leads to a higher data volume retrieved from the data base.
• scalar constants: the constant behaves like a scalar value.

The behavior of the constant can be controlled with the functions SCAL( ) and VECT( ). Please note the following:

1. A constant used in a formula without Exception Aggregation is always a scalar constant.
2. The operators SCAL and VECT have only an effect when used in formulas with Exception Aggregation.
3. Formula Variables (FV) behave similar to constants, but the operators SCAL and VECT do not change the behavior when applied on formula variables.

1. Formula Variables replaced by attribute values use the feature 'exception aggregation for formulas' and hence may behave like a vectorial constant.
2. Formula Variables replaced by the key of a characteristic behave like a scalar constant.
4. In transaction RSRT (see note 1591837) under 'Technical Information', you can check whether a query uses vectorial constants, please see RSRT screenshot.

5. In general, queries with vectorial constants may retrieve a higher data volume from the data base. In particular more partproviders may get accessed. You can use the function SCAL( ) to change the behavior from vectorial to scalar.

1. BUT if formula variables behave like vectorial constants, the operator SCAL (see above) doesn't not have any effect! In this case you can use proper restrictions to reduce the data volume, see Example E6 below.

## Examples

• Restrictions on vectorial constants are considered, in contrast to scalar constants
• If a constant is added to a formula with Exception Aggregation, the query may display more characteristic values in the drilldown
• In general, queries with vectorial constants   may retrieve a higher data volume from the data base (may cause a performance issue).
• Note 1812637 : Implicit behaviour Point 2: A constant behaves like a vector, if it contains a filter explicitly set for this constant...:
• Formula Variables behave similar to constants, but the functions SCAL and VECT have no effect:
• A constant with restriction may get  0  instead of  NULL  in a formula with exception aggregation:
• Constants and Constant Selection:

• No labels