MATH_SUM ()

MATH_SUM ()

MATH_SUM(addend [, addend, ...])

Calculates the sum of a list of addends

If a null addend is provided, it will be ignored.

Input Parameters

Parameter

Type

Default

Required

Description

Parameter

Type

Default

Required

Description

addend

Number/Array

 

Yes

Numeric value to sum. The parameter can be repeated an indefinite number of times.

The function also admits passing an array of numbers as parameter

Execution

Always. Calculated on-the-fly whenever an ITEM of a FORM is changed (by means of form_set_answer(), or when the FORM is opened

Examples

Formula

Description

Formula

Description

MATH_SUM(12, 13, 10)

Result = 35

MATH_SUM([12, 13], 10)

Result = 35

MATH_SUM(ADMISSION.DATA.STEPS)

Sums the values returned by the OBJECT CODE “ADMISSION.DATA.STEPS” (all ITEMS with DATA_CODE=”STEPS”).

Note that the OBJECT CODE can return an array of values