The qualifyif
tag defines conditional logic for qualifying respondents based on their answers.
1. Which age range do you fall into?
type: radio
1. Younger than 18 years old
2. 18 - 24 years old
3. 25 - 44 years old
4. 45 - 64 years old
5. 65 years old or older
qualifyif: anyChecked($Q1,4,5) {text: < 45 yo}
Tip! The termif
tag is the opposite of qualifyif
and may be preferable to match logic specified in a client-copy of a survey. Note, qualifyif
and termif
are opposing functions and should not be applied to the same question/variable.
Details
- To set up qualification logic, add the
qualifyif
tag to a question or non-quota variable and define a logical condition (e.g.,anyChecked($Q1,4,5)
) as its value. - Just like
termif
, thetermtext
tag ortext
decorator customizes the termination text to display in reports. - To streamline code, the
qualifyif
tag andtext
decorator are used in a single line of code as shown above. Alternatively, use a multi-line approach by placing thequalifyif
andtermtext
tags on separate lines. - The logical condition can reference content on the same page or elsewhere within the survey.
- Once a
qualifyif
tag is added to the survey source code, the tracking variablesdisp
anddisp_first
are added to the survey's data. - You can include multiple
qualifyif
tags on a single question, provided each has a unique ID and text decorator. - When a single
qualifyif
tag is used, thetermtext
tag ortext
decorator is optional. However, it is recommended for better clarity and brevity in reports and exports.
Tip! The decorator version of qualifyif
, qualify: y
, can be applied directly to an answer option for simple qualification instructions.
Additional examples
Using the multi-line approach
Let's reuse the example above but apply the multi-line approach using the termtext
tag. This achieves the same results in reports and exports.
1. Which age range do you fall into?
type: radio
1. Younger than 18 years old
2. 18 - 24 years old
3. 25 - 44 years old
4. 45 - 64 years old
5. 65 years old or older
qualifyif: anyChecked($Q1,4,5)
termtext: < 45 yo
Applying multiple 'qualifyif' tags
A question or variable can include multiple qualifyif
tags, each with unique IDs and text
decorators. This ensures individual qualification points have distinct labels and descriptive texts in reports and exports.
11. Which isn't a fruit?
type: checkbox
1. Banana
2. Apple
3. Broccoli
4. Tomato
qualifyif: noneChecked($Q11,1,2) {text: Not paying attn} {id: Q11A}
qualifyif: noneChecked($Q11,4) {text: Selected Tomato} {id: Q11B}
Comments
0 comments
Please sign in to leave a comment.