## 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:

- A constant used in a formula without Exception Aggregation is always a scalar constant.
- The operators
**SCAL**and**VECT**have only an effect when used in formulas with Exception Aggregation. Formula Variables (FV) behave similar to constants, but the operators

**SCAL**and**VECT**do not change the behavior when applied on formula variables.- Formula Variables replaced by attribute values use the feature 'exception aggregation for formulas' and hence may behave like a
**vectorial constant.** - Formula Variables replaced by the key of a characteristic behave like a
**scalar constant.**

- Formula Variables replaced by attribute values use the feature 'exception aggregation for formulas' and hence may behave like a
In transaction RSRT (see note 1591837) under 'Technical Information', you can check whether a query uses

**vectorial constants**, please see RSRT screenshot.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.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).- E4 Sample Query with vectorial constant defined on multiprovider
- E5 Formula with a Constant and Boolean Operator - operator SCAL is used to reduce data volume
- E5.1 Formula with a Constant and Boolean Operator - proper restrictions are used to reduce data volume
- E6 Usage of Formula Variable causes bad performance - restrictions are used to reduce data volume

- 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**: