The create closed tag can be applied directly to a text question to automatically create a closed-end, hidden variable based on a list.
set list: AGE_RANGE
1. 0-17
2. 18-24
3. 25-34
4. 35-44
5. 45-54
6. 55-64
7. 65-74
8. 75+
SAGE. What is your age?
type: text
datatype: whole
create closed: QAGE {list_id: AGE_RANGE} {desc: Age ranges}
In the example above, a QAGE variable will be created with the eight options from the AGE_RANGE list, and the respondent will be assigned to the one in which the age they entered falls.
Details
- The
create closedtag must include an ID and a list. - The list options should be formatted using these conventions:
- number, hyphen, number (e.g., 25-34), or
- hyphen, number (e.g., -18, meaning less than or equal to 18), or
- number, plus (e.g., 75+, meaning 75 or greater).
- The list cannot contain gaps or overlapping ranges.
-
create closedmay be applied multiple times on a question to create different closed-ended variations from a single open-ended variable. - A
descdecorator can be used to provide an alternative description in the reports. - The
create closedvariable can be made into a reporting-only variable by including thereporting onlydecorator. - An inline
quotastag can be included to automatically create a quota from thecreate closedvariable. This tag also allows for inclusion or exclusion syntax.
Additional examples
Applying multiple create closed tags
In the following example, two variables will be created, QINC1 and QINC2, based on the response to QINC. Note that QINC1 and QINC2 are using different lists for their options.
set list: INCOME
1. -24,999
2. 25,000 - 49,999
3. 50,000 - 74,999
4. 75,000 - 99,999
5. 100,000 - 149,999
6. 150,000 - 199,999
7. 200,000 - 249,999
8. 250,000 - 349,999
9. 350,000+
set list: INCOMEGRP
1. -29,999
2. 30,000 - 49,999
3. 50,000 - 99,999
4. 100,000 - 349,999
5. 350,000+
INC. What is your current <b>total annual household</b> income?
type: text
datatype: whole
number format: 0,000
prefix: $
create closed: QINC1 {list_id: INCOME} {desc: Narrower Income Brackets}
create closed: QINC2 {list_id: INCOMEGRP} {desc: Income Brackets}
Creating quotas
In the following example, a quota, QAGE_QUOTA, will be built with the same options as the QAGE question.
set list: AGE_RANGE
1. 0-17
2. 18-34
3. 35-44
4. 45-54
5. 55+
1. What is your age?
type: text
datatype: whole
create closed: QAGE {list_id: AGE_RANGE} {desc: Age ranges} {quotas: y}
Creating quotas with limited included options
In this example, the QAGE_QUOTA quota will only have groups 2-5 from the AGE_RANGE list.
set list: AGE_RANGE
1. 0-17
2. 18-34
3. 35-44
4. 45-54
5. 55+
1. What is your age?
type: text
datatype: whole
create closed: QAGE {list_id: AGE_RANGE} {desc: Age ranges} {quotas: [2..5]}
Including the 'reporting only' decorator
Including reporting only: y on the QAGE variable below ensures that it will be created as a reporting only variable.
set list: AGE_RANGE
1. 0-17
2. 18-34
3. 35-44
4. 45-54
5. 55+
1. What is your age?
type: text
datatype: whole
create closed: QAGE {list_id: AGE_RANGE} {desc: Age ranges} {reporting only: y}
Comments
0 comments
Please sign in to leave a comment.