When added to a question, the create quota
tag uses the specified value as the ID to create a derived quota variable. This tag can be used on any radio, pulldown, or checkbox question and can accept 'y' (yes) and 'n' (no) input, specified option IDs, or conditional statements. Several decorator parameters are supported to allow configuring the quota on the same line.
Derived fields are generated by the system when the survey source is parsed. For more detailed information about quotas, see Quotas overview and Common quota tags.
Syntax
The create quota
tag requires two inputs:
- The quota variable ID (name)
- include the leading 'Q' in the ID, if desired, e.g.,
QVARNAME
- no quotes are needed
- include the leading 'Q' in the ID, if desired, e.g.,
- The quota variable description in a
desc
decorator.
# In a question widget
# Basic
create quota: QVARNAME {desc: Text for describing the derived quota}
Supported decorators and modifications
The following decorators and modifications can be applied to the input used with the create quota
tag.
Modifications / Decorators | Description |
Inclusion/exclusion of options |
Use square brackets to specify which options to include or exclude from the quota, e.g. |
Conditional phrases |
|
chapter |
Use the |
defer_if_none |
Useful for allowing respondents to term at a later point in a survey rather than ending the survey immediately if they do not qualify for any quota buckets. |
defer_if_over |
Useful for allowing respondents to term at a later point in a survey rather than ending the survey immediately if their potential quota buckets are full. |
ifnone |
When a respondent fails to qualify for any existing quota bucket, they will be routed to the page with the label specified with this tag. |
ifover |
When a respondent only qualifies for buckets which are at or over the maximum specified, they will be routed to the page with the label specified with this tag. |
quota base |
Use the |
targetable |
The |
Examples
Inclusion and exclusion
In the example below, the Survey Programmer (SP) uses the create quota
tag twice at Q1, first to create a quota that punches data only for those respondents that select 'Male' or 'Female', and then to create a quota which captures all respondents, including those that select 'Other'.
1. What is your gender identity?
type: radio
create quota: QGENDER [1,2] { desc: Gender Male/Female }
create quota: QGENDER2 { desc: Gender All }
1. Male
2. Female
97. Other
Note, QGENDER [1,2]
could have also been written as QGENDER -[98]
to achieve the same result.
Conditional phrases
Continuing with the example above, we could also write a conditional phrase (an "if statement") that defines the valid options for 'QGENDER'. Both options '1' and '2' are less than '97', therefore, selecting either will punch the quota.
1. What is your gender identity?
type: radio
create quota: QGENDER [ if [id] < 97 ] { desc: Gender Male/Female }
create quota: QGENDER2 { desc: Gender All }
1. Male
2. Female
97. Other
Option data
Another approach for isolating a subset of options is to use a conditional phrase to reference option data from a set list
widget or a spreadsheet that has been invoked on the question. For example, the 'GENDERS' list has option data to differentiate which options qualify for the quota 'QGENDER_MF' versus the quota 'QGENDER_ALL'. At 'QGENDER_MF', if the option data for 'GENDERMF' has a value of '1' (true) for the option selected, the 'QGENDER_MF' quota will be punched.
set list: GENDERS
1. Male {{GENDERALL: 1}} {{GENDERMF: 1}}
2. Female {{GENDERALL: 1}} {{GENDERMF: 1}}
97. Other {{GENDERALL: 1}} {{GENDERMF: 0}}
1A. What is your gender identity?
type: radio
optsfrom: GENDERS
create quota: QGENDER_MF [if [GENDERMF]] { desc: Gender Male/Female }
create quota: QGENDER_ALL [if [GENDERALL]] { desc: Gender All }
Chapter decorator
By default, quotas created with create quota
are placed in the Quota variables chapter. You can specify a different chapter to organize the quota in by placing the chapter
decorator on each quota as needed. Below, we have assigned both quotas to the SCREENER chapter.
define chapters
S. SCREENER
1. What is your gender identity?
type: radio
create quota: QGENDER [1,2] {desc: Gender Male/Female} {chapter: S}
create quota: QGENDER2 {desc: Gender All} {chapter: S}
1. Male
2. Female
97. Other
Note, the define chapters
widget is required.
Other syntax examples
The following decorators involve a complex screener set up which often involves deferring terminations and over quotas until the end of the demographic screener. Please read the article for each respective decorator for comprehensive explanations and examples. These are linked to in the Supported decorators and modifications table in this article.
create quota: QVARNAME { desc: My variable } { quota base: anyChecked($Qn,X) }
... create quota: QVARNAME { desc: My variable } { if none: NEXT } ... create quota: QVARNAME { desc: My variable } { if over: term } ... create quota: QVARNAME { desc: My variable } { defer if over: later_over_page } { defer if none: later_none_page
Comments
0 comments
Please sign in to leave a comment.