Virtual Questions: How to make a custom age range
When you create a Virtual Question, one of the Optional Presets available is the variable age_range. This preset automatically calls up logic for the pre-programmed age ranges of your survey: 13-17, 18-24, 25-34, 35-44, 45-54, 55-64, 65-74, and 75+.
Note: For surveys fielded before October 30, 2023, 65-74 and 75+ will still be consolidated into the pre-release state of 65+.
There are two ways to adjust these ranges to fit your needs.
Combining preset age ranges
To combine several preset age ranges, you can use the operator or; e.g. age_range = '13-17' or age_range = '18-24'.
Note: these ranges cannot be directly modified to capture a custom group of ages. See next section. |
Creating custom age ranges
If you would like to set up your own custom age groupings, you must convert the logic to call up the ages within mathematical operators using the variable age, which captures the exact age of a respondent. For example: age = 18 would capture all respondents who are exactly 18; age < 30 would capture all respondents under the age of 30; age >= 50 would capture all respondents age 50 or older.
|