The quotaOpen
function, also known as "quota look ahead," allows the platform to examine upcoming quotas to see whether a given bucket is full before respondents reach the page hosting the quota.
setlist: BRANDS
randomize: y
1. Gain
2. Tide
3. Arm & Hammer
4. Persil
5. What is your awareness of the following laundry detergent brands?
type: radio table
rowsfrom: BRANDS
1. Never heard of
2. Heard of, but never purchased
3. Purchased, but not in past 12 months
4. Purchased in past 12 months
ELIG_BRAND. Eligible Brands
type: coded multiple select
optsfrom: BRANDS {if anyChecked($Q5R[id],4) and quotaOpen('QBRAND_OVERALL',[id])}
block: <<BLOCK
6R%%ID%%. When was the last time you used %%TEXT%%?
type: radio
1. Today
2. Within the last week
3. Within the last month
4. Within the last three months
5. More than 3 months ago
BLOCK
list: QELIG_BRAND
BRAND_OVERALL. Overall Brand Quota
type: quotas
selectby: weight
optsfrom: BRANDS {if anyChecked($QELIG_BRAND,[id])} {weight: 6-$Q6R[id]}
In the above example, QELIG_BRAND uses quotaOpen
to look ahead to the QBRAND_OVERALL quota to see which buckets are still open based on a respondent selecting option 4 for any of the brands in T5.
Tip! quotaOpen
is an advanced quota method. Ask a Project Consultant to review the survey design and exhaust all other programming options before using it.
Details
-
quotaOpen
can evaluate multiple quota option IDs or a range of IDs. It checks each quota bucket (group) option specified. If any are open, the expression evaluates to '1' (true). Otherwise, it evaluates to '0' (false). - The quota ID should include a leading Q and be surrounded in single quotes — e.g., 'QBRANDS_QTA'.
- Multiple option IDs can be specified in a comma-separated list or using "series syntax" — e.g.,
quotaOpen('QAWARE',1,2)
orquotaOpen('QAWARE',3..5)
. - The
[id]
placeholder can also be used to look ahead at all available quota buckets — e.g.,quotaOpen('QAWARE',[id])
. - The
getQuotaStatus
function can be used for advanced operations such as returning the number of completes or the target for a given bucket, or performing computations.
Additional examples
Using 'getQuotaStatus' for advanced operations
The getQuotaStatus
function acts similar to the fetch_row
function, allowing you to specify a quota variable, return the current count and cap (target) for each option, and perform a computation based on the results.
In the example below, option '99' acts as a placeholder that is never actually selected. It allows getQuotaStatus
to pull all the information from 'QBRAND_QTA' into the temporary 'q_data' variable. Then, an option from the BRANDS list will be selected if that respective quota bucket's count is less than or equal to 75% of the quota cap for that bucket.
LESS_THAN_75. Brands with less than 75% of quota filled
type: coded multiple select
99. Get Quota Status {if my $q_data = getQuotaStatus('QBRAND_QTA') and 1 == 2}
optsfrom: BRANDS { if $q_data->{[id]}->{count} <= ( $q_data->{[id]}->{quota} * .75 ) }
Caution! Great care should be exercised when using advanced functions. Higher levels of traffic and survey data, combined with the use of advanced functions, may affect survey responsiveness. If you encounter any lag when testing, contact Support or send an email to help@intellisurvey.com.
Comments
0 comments
Please sign in to leave a comment.