The skip if
tag is used to dynamically hide questions, tables, or text when a specified condition is true.
1. Which of the following cities have you visited before?
type: checkbox
1. New York
2. Boston
3. Chicago
4. Denver
5. Los Angeles
2. When was the last time you visited Boston?
type: radio
skip if: noneChecked($Q1,2)
1. Within the last month
2. 1-2 mos. ago
3. 3-5 mos. ago
4. 6-12 mos. ago
5. Over a year ago
Tip! The show if
tag is the opposite of skip if
and may be preferable to match logic specified in a client-copy of a survey.
Details
-
skip if
applies to most widgets and question types but should not be used for blocks, groups, or anew page
widget. Use thecondition
tag instead. -
skip if
accepts a conditional statement, 'always', and 'never' as input. - The
skip if
condition can reference content on the same page or elsewhere within the survey. - Use
skip if: always
to always hide a widget, andskip if: never
to always display it. Note, applyingskip if: never
does not override other conditions that may apply to the widget. - To apply
skip if
to a table row or column, thestart table
widget is required. - The related tags
skip if only options
,skip if only rows
, andskip if only columns
apply to questions and tables that reference a previous question's option set. They skip the question if only the specified option IDs are present (e.g.,skip if only options: 98,99
).
Additional examples
Dynamically displaying a 'show text'
The skip if
tag can be used with the show text
widget to dynamically display other content such as text, HTML, images, etc. In the following example, the show text
"SW_FAN" will be skipped if the respondent chooses 'Not really' or 'What's Star Trek?' in Q3.
3. Are you a Star Trek fan?
type: radio
1. Definitely
2. Sort of
3. Not really
4. What's Star Trek?
show text: ST_FAN
text: <p>Live long and prosper!</p>
skip if: noneChecked($Q3,1,2)
Dynamically displaying table rows or columns
To show or hide a table row or column, place a skip if
tag on it. In the example below, the second row in T5 will be hidden if the respondent answered less than '5' in Q4.
4. How long have you been in business?
type: integer
range: 0-60
postfix: years
start table: 5
size: 12
type: text
1. Who is currently your primary distributor?
2. Who was your primary distributor <b>5 years ago</b>?
skip if: $Q4 < 5
end table
The skip if
tag can dynamically show or hide rows and columns in multi-part tables. In T8, column 1 is hidden if Q6 is less than "5," and column 3 is hidden if Q7 is "No."
6. How long have you been in business?
type: integer
range: 0-60
postfix: years
7. Do you anticipate being in business 5 years from now?
type: radio
1. Yes
2. No
start table: 8
intro: What percent of your usage was insource and outsourced?
type: integer
range: 0-100
show column total: Total {total: 100}
if not set: 0
postfix: %
rows:
1. Insourced
2. Outsourced
--
colid: 1
headings: 5 years ago
skip if: $Q6 < 5
--
colid: 2
headings: Today
--
colid: 3
headings: 5 years from now
skip if: $Q7 == 2
end table
Using 'skip if only options'
The skip if only options
tag skips a question or table if only the specified option IDs are present. For example, if Q13 has only options '98' or '99' selected, Q14 and T15 should be skipped as there are no brands to rate. Use skip if only options: 98,99
for Q14 (since optsfrom
is used) and skip if only rows: 98,99
for T15 (since rowsfrom
is used). The same applies to skip if only columns
.
13. Which of the following peanut butter brands have you previously purchased?
type: checkbox
randomize: y
1. Jif
2. Skippy
3. Peter Pan
4. Planter's
5. Smart Balance
98. I'm allergic to peanuts {exclusive: 1,2,3,4,5}
99. I don't buy peanut butter {exclusive: 1,2,3,4,5}
14. Which of these brands of peanut butter is your favorite?
type: radio
optsfrom: Q13
skip if only options: 98,99
15. On a scale of 1-5, how would you rate these peanut butter brands?
type: radio table
optsfrom: series[1..5]
rowsfrom: Q13
skip if only rows: 98,99
Comments
0 comments
Please sign in to leave a comment.