Calculation

On this page you will find instructions on how to set a calculation.

These settings are only available for Date, Text, Number and Selection Questions.

A Calculation to a question allows you to automatically return a value that is calculated on one or more questions and/or aggregations.

If you select a question the Calculation will use the answer to this question as a value for the calculation:

Female Beneficiaries (Question) + Male Benefciaries (Question) = Total Beneficiaries (Calculated)

If you select an aggregation the calculation will use the result of it as a value for the Calculation.

Name

Description

Name

Description

Script is client executable

Enables/disables if calculation will be process in the browser/client or the back-end

Show data origin info

Enables/disables info icon with the name of the aggregation and the source data collection.

Preview Submission Code

Insert submission code here to test the Calculation.

To create a Calculation

  1. click on the Add Button,

  2. add questions of the template and/or aggregations whose value will used for the Calculation and

  3. add a Calculation Script.

Question

For the question you need to select the question and the code.

 

Name

Description

Name

Description

Reference Question (mandatory)

Reference Question whose value will be calculated

Code (mandatory)

Code of the Reference Question that is used as a variable in the Calculation Script

Required question path

Path to a reference of the selected question. Mandatory if used in the calculation script

If the calculation script uses references of the selected question (e.g. trainees.answers.gender) you need to set the required question path for the calculation script to work.

Aggregation Configuration

Add the aggregation by selecting it from the dropdown, enter a code and the key to the return value. For more information on how to set up an aggregation, click here.

Name

Description

Name

Description

Aggregation Configuration

Dropdown of all available Aggregations

Code (mandatory)

Code for the Aggregation that is used for the Calculation Script

Result Selector Path

Key to return value of the Aggregation

Â