The selectby
tag with the steps
method (alias step
or stepwise
) defines a multi-step selection process for quota variables, allowing different selection rules at each step.
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
- The variable must use
type: quotas
. - The
selectby: steps
process cannot be combined with other selection methods. - 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.
- Steps are evaluated in the order they are programmed.
-
By default, step quotas automatically create a separate variable to store the data at each step. The step variables are located in the Survey fields chapter along with the step quota variable. Apply the
steps chapter
tag to change the step question's location in the reporting field tree.
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 the total selected items. A later step cannot exceed the remaining number needed, regardless of the
maxgroups
allowance on that step. - Each step establishes its own
selectby
process.- A step's selection process can be tiered, such as
selectby: counts, weight
. - A step cannot use
selectby: steps
,selectby: percentage
, orselectby: balance
in its own selection process.
- A step's selection process can be tiered, such as
Comments
0 comments
Please sign in to leave a comment.