The apply if
tag can be used on a quota or a selectby
variable so that it applies only to certain respondents. If a respondent does not meet the specified condition, the variable will not be populated.
COUNTRY. Please select the country in which you reside.
type: radio
1. USA
2. Canada
3. Mexico
2. What is your race or ethnic background?
show if: anyChecked($QCOUNTRY,1)
type: radio
1. White or Caucasian
2. Black or African American
3. Asian
4. American Indian, Alaska Native, Native Hawaiian or other Pacific Islander
97. Other ethnicity {autoother: y; placeholder: Specify}
RACE. Race-Ethnicity quota for USA
type: quotas
apply if: anyChecked($QCOUNTRY,1)
optsfrom: Q2
In this example, QRACE will only be applied to those respondents who select "USA" in QCOUNTRY. If a respondent selects any other answer in QCOUNTRY, the QRACE quota will not be populated.
Additional examples
Multiple select question and quota
The apply if
tag can be used on a multiple select question with a follow-up quota or variable that is either single select or multiple select. In the example below, Q1 is a checkbox question and then QCOLA is a multiple select quota that that allows for up to three punches depending on how many applicable options are selected at Q1. If none of the three options are chosen at Q1, the QCOLA quota will not be populated.
set list: SODAS
1. Coke
2. Sprite
3. Pepsi
4. 7UP
5. RC Cola
6. Dr Pepper
7. Sunkist
8. Mountain Dew
9. Fanta
10. Canada Dry Ginger Ale
1. Which of the following brands of soda do you regularly drink?
type: checkbox
opts from: SODAS
COLA. Quota for cola brands
type: quotas
maxgroups: 3
apply if: anyChecked($Q1,1,3,5)
optsfrom: SODAS [1,3,5] {if anyChecked($Q1,[id])}
Comments
0 comments
Please sign in to leave a comment.