A quota, once capped, is a predefined limit that controls how many respondents with specific characteristics can complete the survey. The type: quotas
tag is used to create a standalone quota variable when the quota needs don't match the question's option list, depend on multiple conditions or questions, involve complex selection logic, apply to multi-country surveys, or use audience sheets.
1. What is your occupation?
type: radio
randomize: y
1. Teacher
2. Doctor
3. Nurse
4. Electrician
5. Professor
6. Plumber
97. Other {autoother: y}
OCCUPATION. Occupation type
type: quotas
1. Educator {if anyChecked($Q1,1,5)}
2. Medical field {if anyChecked($Q1,2,3)}
3. Trade {if anyChecked($Q1,4,6)}
4. Other {if anyChecked($Q1,97)}
This article discusses the type: quotas
widget, designed for creating quotas with custom groupings. For a simple quota based on the same options as the question referenced in the logic, try creating a derived quota with the quotas
tag.
Details
- Quotas require a question ID, the
type: quotas
tag, and one or more options to choose from. These options are often referred to as quota "buckets" or groups. - By default, quotas are single select. To create a multiselect quota, include the
maxgroups
tag, and specify the maximum number of quotas that can be assigned. - Quotas can use inline options or reference single lists or crosslists by using the
optsfrom
tag. - Conditions can be directly applied to individual quota options using the
condition
decorator. - Just like with questions, conditions, option data, and other element decorators (e.g., 'weight') applied to lists are carried forward to quotas where the list is referenced, unless explicitly overwritten at the quota with a new condition or decorator.
- The
click balance quotas: y
tag can be added to a quota variable to automatically create click balance quotas based on the same quota options. - Quotas are managed in the Quotas applet.
Understanding the selection process
A variable using type: quotas
has selectby: condition
integrated into the quota selection method. You can modify this by applying the selectby
tag and listing one or more selection methods separated by commas. For example, to indicate a selection process by 'weight' first, then by 'counts', use selectby: weight,counts
.
All selectby
methods prioritize conditions first, whether from a condition
decorator or inherited from an independently created list. Once the options are filtered by conditions, the specified selectby
method, such as 'weight,' is applied. If there's a tie, the selection is made following the second selection method listed. If no second selection method is listed, this is made randomly.
Quotas in reporting
Quotas appear in the order they are programmed in the reporting field tree. To place a quota in a different chapter, use the chapter
tag and specify the chapter's label. For example, to put the quotas in the Quota variables chapter along with derived quotas, add chapter: quotas
to the variable.
Respondents receive a status of 'T' ("Terminated") if they fail to qualify for a quota. If they qualify but the quota is full, they are marked as 'Q' ("Over Quota"). The oq
system variable tracks over quota data.
Tags
When creating quotas in a survey, there are several standard tags available along with additional tags that can enhance functionality to meet your needs. We list the most common tags below. See Common quota tags for additional tags frequently used with quotas.
Tag | Description |
applyif |
Sets a condition that, if "true" for a respondent, evaluates them for available quota groups. If the condition is not met, the respondent skips the quota entirely, regardless of whether they qualify for any open bucket or not. |
chapter |
Designates a different folder to host the quota variable. |
defer if none |
Delays the termination of a respondent who does not qualify for any quota groups. |
defer if over |
Delays the termination and "Over Quota" status for a respondent who only qualifies for quota groups that are full. |
maxgroups |
Specifies the maximum number of quota groups a respondent can be assigned to, provided they meet the qualifying conditions and the quota bucket is not full. Without the |
selectby |
Defaults to |
Additional examples
Building quotas from multiple questions
The example below combines respondents' answers from Q7 and Q8 to determine which sections should be answered for Restaurant 1. The condition
decorator is added to each quota group to specify the answers that qualify for that particular group. Notice every respondent has a potential quota group, as all answer options for Restaurant 1 are accounted for.
setlist: BRANDS
randomize: y
1. Restaurant 1
2. Restaurant 2
3. Restaurant 3
4. Restaurant 4
5. Restaurant 5
7. Which of the following restaurants have you heard of / are familiar with?
type: radio table
1. Never heard of
2. Heard of but not considered
3. Heard of and considered and / or purchased from
rowsfrom: BRANDS
8. Of the following, which have you purchased from?
type: radio table
1. Considered but not purchased from
2. Purchased from over a year ago but not in the last year
3. Purchased from within the last year
rowsfrom: BRANDS {if anyChecked($Q7R[id],3)}
ROUTING. QTA | Restaurant 1
type: quotas
chapter: quotas
1. Never heard of (Does not see Section 2 or 3) {if anyChecked($Q7R1,1)}
2. Deep Dive Barriers (Sees Section 2) {if anyChecked($Q7R1,2) or anyChecked($Q8R1,1,2)}
3. Deep Dive Current (Sees Section 3) {if anyChecked($Q8R1,3)}
Applying a quota to specific respondents
Quota variables are generally designed to be inclusive of all respondents. However, if a quota doesn’t need to cover all respondent groups, use the applyif
tag. For a respondent to qualify for a quota bucket, the condition specified by the applyif
tag must be met. If not, the respondent skips the quota entirely.
For example, Q2 is only shown to respondents from the USA, and the QRACE quota applies only to these respondents. This quota also uses question label shorthand, which is explained in the next example.
COUNTRY. Respondent Country invisible: y type: radio cvalue: url_param('c') 1. USA 2. Canada 3. Mexico 2. What is your race or ethnic background? showif: 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. QUOTA | Race-Ethnicity
type: quotas
applyif: anyChecked($QCOUNTRY,1)
optsfrom: Q2
Using question label shorthand
Continuing with the example above, we use question label shorthand to reference the quota options and apply the condition. Question label shorthand is an abbreviated way to write a conditional statement using anyChecked
to reference a single question or variable.
The code optsfrom: Q2
is shorthand for "all options selected at Q2". Since Q2 is a single-select question, only one quota option can be assigned per respondent at QRACE.
2. What is your race or ethnic background?
showif: 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. QUOTA | Race-Ethnicity
type: quotas
applyif: anyChecked($QCOUNTRY,1)
optsfrom: Q2
Making a quota multiselect with 'maxgroups'
Often, a respondent may qualify for multiple quota buckets. A common example is brand assignments. The maxgroups
tag can be added to the quota widget, allowing respondents to be assigned to anywhere from a minimum of '1' up to the specified value of the tag (e.g., '3').
4. Which fast food chains are you aware of?
instruct: Select all that apply
type: checkbox
randomize: y
1. McDonald's
2. Burger King
3. KFC
4. Checkers
5. Sonic
97. Other {autoother: y} {anchor: y}
99. None of these {anchor: y} {term: y} {exclusive: y}
5. Which of these fast food chains have you purchased from in the last 12 months?
type: checkbox
optsfrom: Q4-[99]
L12M_FASTFOOD. Chains purchased from in last 12 months [Max 3]
type: quotas
maxgroups: 3
optsfrom: Q5
Creating regular quotas and click balance quotas together
It's also possible to apply the click balance quota
tag to a quota variable. Adding click balance quota: y
to the standalone quota variable creates a click balance quota with the same quota groups as QAGE_QTA.
AGE. What is your age? type: integer range: 18-100 AGE_QTA. Age Click-Balance Quota type: quotasclick balance quota
: y
1. Young {if $QAGE < 40}
2. Middle Aged {if $QAGE >= 40 and $QAGE < 65}
3. Senior {if $QAGE >= 65}
Prioritizing quotas with weights
When using selectby: weight
, the quota selects options based on a defined priority, or weight value, in the survey code, with the highest weight selected first. Weights can be static or dynamic and can be applied as a decorator on the originating list or directly on the option in the quota widget.
In the example below, the QCATS quota selects up to two quotas based on the respondent's answer at Q9. If the respondent qualifies for all three quota buckets, the two with the highest weights, "Chilled pizza" and "Savory snacks," will be assigned.
9. Which of the following brands have you purchased before?
type: radio table
1. I have never bought this brand before
2. I have bought this brand but not in the last 12 months
3. I have bought this brand in the last 12 months
rows:
101. Screamin' Sicilian
102. Red Baron
201. Crosta & Mollica
202. Gino D'Acampo
301. Ryvita
302. Jacobs
CATS. QTA| Categories seen for mini loops
type: quotas
selectby: weight
maxgroups: 2
1. Frozen pizza {if anyChecked($Q9R101,3) or anyChecked($Q9R102,3)} {weight: 1}
2. Chilled pizza {if anyChecked($Q9R201,3) or anyChecked($Q9R202,3)} {weight: 10}
3. Savory snacks {if anyChecked($Q9R301,3) or anyChecked($Q9R302,3)} {weight: 100}
Changing the selection process with 'selectby'
In the example below, QLAST_VISIT uses 'weight' and 'counts' for its selection process. The quota references the BRANDS list, inheriting the weights assigned to each option. First, the available quota options are filtered by the condition, which requires the brand to be "Purchased from within the last 12 months." Then, the option with the highest weight, as specified in the weight
decorator, is assigned. If there is a tie, the option with the fewest completes will be selected.
setlist: BRANDS
randomize: y
1. Restaurant 1 {weight: 1000}
2. Restaurant 2 {weight: 10}
3. Restaurant 3 {weight: 1}
4. Restaurant 4 {weight: 100}
5. Restaurant 5 {weight: 100}
8. Of the following, which have you purchased from?
type: radio table
99. Never heard of
1. Not considered
2. Considered but not purchased from
3. Purchased from over a year ago
4. Purchased from within the last 12 months
rowsfrom: BRANDS
LAST_VISIT. Last visit selection
type: quotas
selectby: weight,counts
optsfrom: BRANDS {if anyChecked($Q8R[id],4)}
Notice that the weight
decorator is applied to each list option when the list is created, as opposed to placing it directly on the quota options shown in the previous example. The weighted values carry forward and are used during the quota selection process.
Using crosslists with quotas
Crosslists are lists built from combining options from two or more lists. In the example below, GENCOUNTRYLIST uses question label shorthand to "cross" the values from QCOUNTRY and the quota assigned at QGENDER. Since both QCOUNTRY and QGENDER are single select variables, only one option is stored for each, resulting in one possible combination.
For instance, if a respondent is from China and selected "Male," the values stored are '2. China' and '1. Male'. The crosslist uses question label shorthand to pull in '2' and '1', producing the result '2_1' ("China, Male"). When the quota QCOUNTRYGEN references GENCOUNTRYLIST, the only viable quota option for this respondent is "China, Male." This creates a crossed quota based on answers from both questions.
COUNTRY. VAR | Country
translate: n
invisible: y
type: radio
1. United States
2. China
3. India
4. Japan
5. Brazil
99. No country
cvalue: if (url_param('c') > 0) {url_param('c')} else {99}
termif: $testmode == 0 and anyChecked($QCOUNTRY,99)
termtext: QCOUNTRY | No country passed
...
SGEND. What is your gender?
type: radio
1. Male
2. Female
97. Other gender identity
GENDER. QUOTA | Gender
type: quotas
optsfrom: QSGEND
setlist: GENCOUNTRYLIST
crosslists: QCOUNTRY,QGENDER
COUNTRYGEN. QUOTA | Gender-Country
type: quotas
optsfrom: GENCOUNTRYLIST
Applying an audience sheet
The audience sheet
tag or decorator is what triggers our platform to place a quota in the Audience Quotas applet instead of the Quotas applet. The audience sheet
tag/decorator requires an audience sheet as input.
In the example below, QGENDERQ uses the audience sheet 'audience_us_gender' to match results of the quota with existing US gender demographics.
setlist: GENLIST
1. Male
2. Female
GENDERQ. Gender group quota
type: quotas
audience sheet: system.audience_us_gender
optsfrom: GENLIST
Comments
0 comments
Please sign in to leave a comment.