Calculation task executes a stored procedure on the database server. For example, use this task to run the stored procedure that runs the conversion (foreign exchange) calculations.

Calculation task

Note: The Consolidation application provides several out-of-box workflows which run various consolidation Calculations in the global folder Anaplan\Consolidation\Processes. The best way to use these calculations is to use a Run workflow task. You shouldn't create your own Calculation task that calls the stored procedure.

The key parameters include:

ParameterDescription
NameEnter the name that appears on the task.
Type

Select the type of script to be run:

  • Stored Procedure: Select this option to run a SQL stored procedure. For example, fl.ValidationRules.
Data Source

Select the schema where the stored procedure is located. Select one of:

  • appdb
  • appdbreadonly
Stored Procedure NameName of the stored procedure to run.
Result Variable

If the stored procedure returns a result, use this parameter to specify a result variable to save it to. You can refer to this variable using the {} process syntax in future tasks.

For example,

  • If the Result Variable is set to myVariable:
    • A subsequent Send Email task can use it in the message: procedure executed and returned {myVariable}
    • A subsequent Decision task can use it when evaluating: "{myVariable}" == "0"

The return value is always converted to a string.

ParametersIf the stored procedure requires any parameters, they are defined in the Parameters section.
Timeout

Enter the time that the system will wait for the activity to complete. 

Set this parameter to let the workflow to progress if the calculation is taking longer then expected. A calculation taking longer than expected shows that there's an error in the calculation. 

If a timeout isn't set, the workflow would be blocked indefinitely if the stored procedure encountered an error and never returned back to the calling workflow.

Advance RuleSpecify how to advance to the task. The default is All predecessors have completed. 

To configure the Calculation task:

  1. Drag the Calculation task onto the Workflow Editor canvas to add it.
    Find the Calculation task in the Application section of the Workflow toolbox.
  2. Select the Calculation task and select the Edit icon to edit the parameters in the Task Configuration pane. 
  3. Fill in the required parameters. If the Type is Stored Procedure:
    1. Enter the name and parameters of an SQL stored procedure.
    2. If the stored procedure returns a result, use this parameter to specify a result variable to save it to.
    3. Select the Data Source indicates the schema to run the SQL statement against.
    4. If the Stored Procedure has parameters, select New Parameter to add them as required. For every parameter, there's a Name and Value pair.
      • Name: It's the name of the parameter for the stored procedure.
      • Value: It's the value of the parameter. You can either hard-code the value, use the value passed in from the Process Options in the Start task, or use Global Variables.
Types of parameter valuesExample
Hard-coded

Name = Entity

Value = Europe

Process Options

Name = Date

Value = {ProcessParameter.Period.Name}

Global Variables

Name = Model

Value = {Global.ConsolDataModel}

  1. Select OK to apply changes in the Task Configuration pane. 
  2. Select Save to save the workflow.
  3. Select Play in the Workflow Editor toolbar to start the workflow. 
    The workflow process starts.