Variable 
Variables are used to parameterize a query, a planning function, a filter, a characteristic relationship or a data slice. When a query, planning function or Web application is executed, they are filled with values.
Variables act as placeholders for characteristic values, hierarchies, hierarchy nodes, texts, and formula elements, and can be processed in many different ways.
Depending on the objects for which you want to define variables, there are different variable types. For more information, see the documentation on the Query Designer under Variable Types.
The processing type determines how a variable is filled with a value for the runtime of the query, planning function or Web application. For more information, see the documentation on Query Designer under Processing Types for Variables.
Example
Variables allow you to use a single planning function definition as the basis for many different queries. You want to create a planning function of type Copy that copies your current data from the current version to another one. You use a variable for the Version characteristic in the To parameters of the planning function. Before executing the planning function, decide which version you want to copy the current data to.
Note
For formula variables that are used in planning functions, for conversion functions for example, processing type Replacement Path cannot be used. Only the Number dimension is supported here.
You can make unrestricted use of text variables in input-ready queries.
Variables do not depend on an InfoProvider, but on the respective InfoObject only. A variable that you define for an InfoObject is available in all InfoProviders that use this InfoObject.
You can define variables can in Query Designer and im Planning Modeler.
The same variable can have different values in different locations. A separate instance of the variable is created whenever a variable is filled with a value. In some cases different instances (and therefore the values) of variables are merged into a single instance. This means that the variable has the same value in all the objects involved. This happens, for example, when a variable is used in two different queries. However, this is only the exception.
Variables help you to flexibly set or parameterize your objects. The following objects support the use of variables:
Object |
Using Variables |
|---|---|
Queries (especially input-ready queries) |
|
Filter |
To parameterize characteristic restrictions that describe the filter. |
Planning Functions |
Depending on the respective planning function type, to parameterize conditions and parameters, for example, to parameterize the conversion factor in planning functions of type conversion. Variables can be assigned values in the following ways:
|
Characteristic relationships |
|
Data slices |
To parameterize characteristic restrictions that describe the data slice. |
Note
Variables that are used in characteristic relationships and data slices cannot call a dialog for the manual entry of values. These variables must have a value at the time of execution.
The different ways in which variables are used result in different times at which variables are executed and at which they are assigned new values.
Use |
Time of Variable Call |
|---|---|
Query |
|
Planning function |
Only when executing the planning function. Explicitly set variable values have priority over implicitly set variable values here too. This results in the following conditions for defining the priority when filling a variable:
|
Planning sequence |
See Planning Function |
Filter in planning sequence |
Each time the planning sequence is executed. |
Data slice |
The first time it is called. You cannot change data slices by changing variables. If no variables are set, the dialog box Change Variables for Variables does not appear.
It must be possible to replace variables used in data slices automatically. Variables that are entered manually are not allowed. End of the note. |
Characteristic relationship |
See Data Slice |
If there are two variables with the same name in two different objects, the system creates instances of these variables. From then on there are physically two variables. In certain constellations the system automatically merges these instances so that all variable instances have the same value.
Constellation |
Merge |
|---|---|
Variables with same name in two queries |
Yes. |
Variables with same name in planning function and query |
Only in BEx Analyzer and if the variable value was not replaced by a command there.
To ensure the same value in a Web application, the executing command must perform data binding. End of the note. |
Variables with same name in planning sequence and query |
See Planning Function |
Filter and planning function within a planning sequence |
Yes. |
Data slice or characteristic relationship with any other object |
No. |
You can find more (context-sensitive) information about creating and changing variable definitions (Variables Wizard and Variables Editor) under Variables in the documentation for Query Designer and for Planning Modeler, under Editing Variables .