Execute Calculation
The MaxL execute calculation statement helps you calculate an Essbase block storage database. You can use this statement to run a stored calculation script, a calculation string, or the default calc.
Click here for aggregate storage version
Using this statement, you can execute a particular stored calculation, or the default stored calculation (determined by alter database), or an anonymous (non-stored) calculation string.
The minimum permission required to run a stored BSO calculation is having that calc script provisioned to you. To run an anonymous calculation (CALC-STRING method) or the default calculation, the minimum application permission required is Database Update.
Keywords
You can run BSO calc scripts in the following ways using MaxL execute calculation.
- execute calculation CALC-NAME
-
Run the specified stored calculation script.
Example:
execute calculation Sample.Basic.Calc1;
Calculates the Sample.Basic database using the stored calculation script file named Calc1, which is associated with the database.
- execute calculation CALC-NAME on database DBS-STRING
-
Run the specified stored calculation script against the specified database.
Example:
execute calculation Sample.Calc2 on database Basic;
Calculates the Sample.Basic database using the stored calculation script file named Calc2, which is associated with the Sample application.
- execute calculation CALC-STRING on DBS-NAME
-
Run an anonymous calculation, whose body is contained in CALC-STRING, against the specified database.
Example:
execute calculation 'SET MSG ERROR; CALC ALL;' on Sample.Basic;
Calculates the Sample.Basic database using an anonymous (unstored) calculation string.
- execute calculation default on DBS-NAME
-
Run the default calculation against the specified database.
Example:
execute calculation default on Sample.Basic;
- execute calculation CALC-NAME with runtimesubvars RTSV-LIST
-
Run the specified stored calculation script with the runtime substitution variables specified in RTSV-LIST, which is a string of runtime substitution variables specified as key/value pairs. The string must be enclosed with single quotation marks, and the key/value pairs must be separated by a semicolon, including a semicolon after the last runtime substitution variable in the string and before the terminal single quotation mark. In this example of a runtime substitution variable string, the name and value of four runtime substitution variables are specified (for example, the value of the runtime substitution variable named "a" is 100):
'a=100;b=@CHILDREN("100");c="Actual"->"Final";d="New York";'
The string of runtime substitution variables cannot exceed 64 KB.
Example:
execute calculation Sample.Basic.Calc3 with runtimesubvars ‘a=100;b=50;’;
Calculates the Sample.Basic database using the stored calculation script file named Calc3, which is associated with the database, and the specified runtime substitution variables, in which the value of the runtime substitution variable named "a" is 100 and the value of "b" is 50.
Note:
Runtime substitution variables used in a calculation script must be declared in the SET RUNTIMESUBVARS calculation command, with a name and default value. If a different value is declared in the RTSV-LIST, the default value is overwritten at runtime.
If you include a runtime substitution variable in RTSV-LIST that has not been declared in SET RUNTIMESUBVARS, Essbase ignores the undeclared runtime substitution variable (no warnings or exceptions are generated).
Runtime substitution variables that are used in a calculation script can be logged in the application log file, using the ENABLERTSVLOGGING configuration setting.
If the name of a runtime substitution variable that is declared in the SET RUNTIMESUBVARS calculation command is the same as a runtime substitution variable declared in RTSV-LIST, the value specified in RTSV-LIST overwrites the default value in SET RUNTIMESUBVARS.
Notes
-
A stored calculation can be associated with a specific database in an application (database level), or with an application only (application level). To execute a calculation stored at the application level, you must specify which database in the application to calculate using the on database STRING grammar.
-
A calculation script can reference runtime substitution variables using the with runtimesubvars grammar.