Routing rule expressions
You can find out more by watching this video demonstrating how to add expressions.
If conditions for single and multiple response questions
The conditions used for routing must return true or false.
These conditions are mainly for use in single or multiple response questions.
Symbol | Text | Meaning | Example |
---|---|---|---|
= | MT | Value matches | If Q1 = 3 is true when code 3 is selected in response to Q1 |
== | EQ | Exact value match | If Q1 == 3 is true when code 3 is the only code chosen in response to Q1 |
<> | NE | Not an exact value match | If Q1 <> 3 is true if any other code than 3 has been selected in response to Q1 (even if code 3 has been selected as well) |
< | LT | Less than | If Q1 < 5 is true when the selected code has a value less than 5 |
<= | LE | Less than or equal to | If Q1 <= 5 is true if the code selected has a value of 5 or less than 5 |
> | GT | Greater than | If Q1 < 5 is true if the code selected has a value greater than 5 |
>= | GE | Greater than or equal to | If Q1 >= 5 is true if the code selected has a value of 5 or greater than 5 |
, | OR or | Or | If Q1 =(1, 3, 5) is true is Q1 has a value of 1,3 or 5 |
~ | TO to | Range, from first value to second value | If Q1 =(1~5) is true if Q1 has a value of 1, 2, 3, 4 or 5 |
# | NUM num | Number of responses | If Num(Q1=2) is true if two answers have been ticked for Q1 |
If conditions for any question
These conditions are for use with any type of question.
Q1 NA | This is true if Q1 is not asked |
Q1 OK | This is true if a valid answer has been given to Q1 |
Q1 NR | This is true if an answer has not been recorded to Q1 |
Examples of If conditions
These examples show possible conditions applied to single or multiple response questions
If Condition | Meaning |
---|---|
Q7=2 | Code 2 is selected in Q7 |
Q3>3 | Any code above code 3 is selected in Q3 |
Q3<3 | Any code below code 3 is selected in Q3 |
Q3>=3 | Code 3 or above is selected in Q3 |
Q3<=2 | Code 2 or below is selected in Q3 |
Q7=(1,4) OR Q7=(1 or 4) | Code 1 or code 4 is selected in Q7 |
Q7=(3~5) | Code 3 or code 4 or code 5 in selected in Q7 |
Q7==2 | Only code 2 is selected in Q7 (Q7 is a multiple response) |
(Q2=2 OR Q4=1) | EITHER code 2 is selected in Q2 or code 1 is selected in Q4 |
(Q2=2 AND Q4=1) | BOTH code 2 of Q2 is selected AND code 1 of Q4 is selected |
(Q2=2 AND Q4=1) | BOTH code 2 of Q2 is selected AND code 1 of Q4 is selected |
(Q2=2 OR Q4=1) AND Q5>=10) | EITHER code 2 of Q2 is selected or code 1 of Q4 is selected, and also gave an answer of 10 or above to Q5 |
NUM Q2=2 | Two answers have been selected at Q2 (Q2 would be a multi response question) |
UNLESS (Q2=2) | Code 2 is NOT selected in Q2 |
NOT(Q1=4) | Code 4 is NOT selected in Q1 |
UNLESS (Q2=2)OR NOT(Q1=4) | Either code 2 is NOT selected in Q2 or code 4 is NOT selected in Q1 |