Elements that are part of a row or column repeater can also be used in Calculation elements. However, they have a different syntax to normal elements and some specific formulas that will apply to them.
For all elements NOT part of a repeater, the user can simply input ':' and a list of their elements will display, as shown below:
Any element part of a repeater will NOT show in this list.
To access the repeater element the user should use '$'. Inputting this will display all elements part of a repeater:
Rules and Calculations of Repeater Elements:
Returning all results from an element in a repeater:
Inputting $element$ will return the total for that element part of the repeater.
Returning a specific result from a repeater:
To return a specific value from a repeater element the User should use this equation:
INDEX($repeaterElement$, index value)
The index value is 1 based, NOT 0 based like normal programming functionality.
Checking if a repeater contains a value:
To check if a repeater element contains a specific value the User can make use of this function:
CONTAINS($repeaterElement$, value)
-
Use TRUE or FALSE for Boolean.
-
Use double quotes(““) for any string values.
-
Numbers should be inputted as is without any quotes
-
Dates should be inputted as “YYYY-MM-DD“.
Checking how many results were inputted for an element repeater:
To check how many results were inputted for a repeater element the User can make use of the LEN (short for Length) calculation.
LEN($repeaterElement$)
This will return the number of inputted values for the element NOT the number of repeats.
How to Run a Calculation for Each Repeater Container:
In many cases, the User may wish to have a Calculation within each container repeater.
For this scenario it is important they follow this syntax:
INDEX($number-1$, @) - The @ will automatically set the current index values of the element in the repeater.
How to Return the Index of the Repeater:
To return the index of the repeater simply add a Calculation Element with '@' as the formula. This will return the current index value.
Comments
0 comments
Please sign in to leave a comment.