Execute Calculation

Click here for aggregate storage version

Execute a stored calculation, the stored default calculation (determined by alter database), or an anonymous (non-stored) calculation string.

Minimum permissions required:

  • For stored calculations (CALC-NAME): Granted access to the calculation.

  • For anonymous calculations (CALC-STRING) and the default calculation: Execute

Syntax

Syntax diagram for execute calculation.CALC-NAMEDBS-STRINGRTSV-LISTCALC-STRINGDBS-NAME

You can run calculations in the following ways using execute calculation.

KeywordDescription

execute calculation <calc-name>

Run the specified stored calculation script.

<calc-name> on database

Run the specified stored calculation script against the specified database.

<calc-string> on <dbs-name>

Run an anonymous calculation, whose body is contained in <calc-string>, against the specified database.

default on <dbs-name>

Run the default calculation against the specified database.

<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";'

Note:

The names of all runtime substitution variables used in a calculation script must be declared in the SET RUNTIMESUBVARS calculation command; optionally, default values can be specified in SET RUNTIMESUBVARS. 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. See “Logging Runtime Substitution Variables” in the Oracle Essbase Database Administrator's Guide.

If a default value for a runtime substitution variable is specified in SET RUNTIMESUBVARS and a runtime substitution variable with the same name is included 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.

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 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
  'SET MSG ERROR;
   CALC ALL;'
on Sample.basic;

Calculates the Sample.Basic database using an anonymous (unstored) calculation string.

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.

See Also