Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
bgColor#DEEBFF#B3D4FF

Average

The ‘Average’ formula is used to average all responses for any given question. Formula parameters include:

...

Note: If the 3rd parameter is part of the function call, then the corresponding parameters corresponding to that option become necessary.

Example:

...

Panel
bgColor#DEEBFF#B3D4FF

Iff

The ‘Iff’ formula is used to evaluate a certain condition and then further evaluates a formula based on how the condition is evaluated. Parameters include:

...

  • Iff(Contains([QuestionOne], 2), 1, 0)

    • The “Condition to check” is “Contains([QuestionOne],2)”

    • The “Value if TRUE” is 1

    • The “Value if FALSE” is 0

    • If the participant included option value 2 in checkbox question [QuestionOne], then the “Condition to check” equates to TRUE and the “Value if TRUE” will be assigned to the Calculated Field Question, which is 1.

    • If the participant didn’t include option value 2 in checkbox question [QuestionOne], then the “Condition to check” equates to FALSE and the “Value if FALSE” will be assigned to the Calculated Field Question, which is 0.

Panel
bgColor#DEEBFF#B3D4FF

DateDiff

The ‘DateDiff’ formula is used to evaluate the difference between two Date (and Time, if available). Parameters include:

...

  • DateDiff('yesterday', ‘now', 'm')
    This calculates the total minutes between yesterdays date and the date and time right now.
    If the yesterdays’ date is 07/10/2023 and we are evaluating this function at 07/11/2023 at 4:07pm then the result should be about: -2407.5039294216667

Panel
bgColor#DEEBFF#B3D4FF

Contains

The ‘Contains’ formula is a TRUE/FALSE statement used to check if a particular option was selected in a checkbox question type. In CMS (platform v1), the way to do that is to write something like this: [checkboxq(value)] == 1. This has been changed up in V2. The new formula to check if a checkbox contains a specific value is:

...

  • Contains([CheckboxQ1], 3)
    The formula will get the last response(s) for the question “CheckboxQ1” and check if ‘3' was one of them. If ‘3’ was one of them the logic will return TRUE and if '3’ was not one of them the logic will return FALSE.

Panel
bgColor#DEEBFF#B3D4FF

Checkbox Syntax

Checkbox syntax from CMS is now supported. [CheckboxQuestion(1)] will result in 0 if the option with value “1” was not selected by participant and vice versa. This syntax doesn’t support default value format such as [RadioQuestion:-999] (which will result in a default value of -999 if no value was found for the question “RadioQuestion”]

Panel
bgColor#DEEBFF#B3D4FF

ResponseExists/Exists

This formula is used to check if a particular question has been recorded in the Database with a response or not. This formula accepts one parameter which is the question name. The formula returns true if a response was found and false if a response was not found.

...

  • ResponseExists([RadioQ])

  • Exists([RadioQ])

Panel
bgColor#DEEBFF#B3D4FF

last or [*]

The constructs last() and [*] existed in CMS but they don’t exist in V2.

Panel
bgColor#DEEBFF#B3D4FF

Default Values

Default values (applied when a response for a question cannot be found) can be defined in the declaration of question name followed by a colon “:”.

...