The selectby
tag with the steps
method (alias step
or stepwise
) is used on a quota variable to specify a series of programming steps for the software to select multiple options. This method was designed specifically for quotas with multiple steps, where each step may involve different selection methods, conditions, or maximums.
Example
set list: BRANDS
1. Coke
2. Dr Pepper
3. Pepsi
4. Sprite
5. Diet Coke
6. Mountain Dew
7. Coke Zero
8. Diet Pepsi
9. Fanta
10. Canada Dry Ginger Ale
7. Which of the following brands have you heard of?
type: checkbox
optsfrom: BRANDS
8. Which of the following brands have you ever purchased?
type: checkbox
optsfrom: BRANDS {if anyChecked($Q7,[id])}
99. None
9. Which of the following brands have you purchased in the past three months?
type: checkbox
optsfrom: BRANDS {if anyChecked($Q8,[id])}
99. None
10. Which brand is your favorite?
type: radio
optsfrom: BRANDS
BRANDS. 2 Brands for deep dive
type: quotas
selectby: steps
optsfrom: BRANDS
maxgroups: 2
steps:
1. Primary brand {if anyChecked($Q10,[id])} {maxgroups: 1} {selectby: condition}
2. Purchased competitor [1,3,5,7,8] {if anyChecked($Q8,[id])} {maxgroups: 1} {selectby: condition}
3. Recent brand {if anyChecked($Q9,[id])} {maxgroups: 2} {selectby: counts}
4. Other brands {if anyChecked($Q7,[id])} {maxgroups: 2} {selectby: counts}
Details
- Steps are evaluated in the order they are presented.
- Each step must have the following decorators: a condition,
maxgroups
, andselectby
. If needed, you can filter the option set with inclusion/exclusion and option data syntax. - The variable must use
type: quotas
. - The
maxgroups
tag is required on the quota to define the maximum number of total options that can be selected. - You can optionally apply the
steps chapter
tag (aliasstep chapter
) to change the step question's location in the reporting field tree. By default, the step variables are located in the Survey fields chapter along with the step quota variable.
Understanding step quota behaviors
There are several step quota behaviors that are helpful to understand.
- An item selected in an earlier step cannot be chosen in a later step.
- Step quotas keep a running count of selected items. A later step cannot exceed the remaining number needed, regardless of the
maxgroups
allowance on that step. - The
selectby: steps
process cannot be combined with other selection methods. - Each step establishes its own
selectby
process.- A step cannot use
selectby: steps
in its own selection process. - A step's selection process can be tiered, such as
selectby: counts, weight
. -
selectby: percentage
andselectby: balance
are not supported.
- A step cannot use
- Steps are evaluated in the order they are listed, not by option ID. A set of steps labeled, "1,2,4,5,3" is acceptable.
- Non-numeric labels like '2A' are also acceptable.
- Step quotas automatically create a separate variable to store the data at each step. These variables are named QNAME_[id], where "NAME" is your quota label and [id] is the step's ID (e.g., from the example above, step 2 would be QBRANDS_2).
Comments
0 comments
Please sign in to leave a comment.