logo SmartSurvey / Scripting Docs
Back to Docs
Question Type
4 Numeric Response Numeric *NUMBER

Captures a single numeric value from the respondent. Supports integer and decimal input with optional MIN:/MAX: range constraints. The response can be used directly in arithmetic comparisons.

Type ID 4
Directive *NUMBER
Category Numeric
Script Definition
script definition (.q)
*QUESTION Q4 *NUMBER
Q4. How old are you?

-- Limiting the Numeric Range with *MIN and *MAX:
*QUESTION Q4 *NUMBER *MIN 18 *MAX 65
Q4. How old are you?

-- Allowing "Don't Know/Can't Say" with *DKCS:
-- *DKCS defines a special opt-out code (e.g. 99) that a respondent can enter
-- instead of a real numeric value when they do not know or cannot answer.
*QUESTION Q4 *NUMBER *MIN 18 *MAX 65 *DKCS "Don't Know/Can't Say" "99"
Q4. How old are you?
Use in Expressions
expressions
Q4>=18             -- respondent is an adult
Q4<25              -- below 25 years old
Q4>=18 & Q4<=34    -- in the 18–34 age bracket
valueof[Q4]>=18    -- equivalent to Q4>=18
Q4 and valueof[Q4] are equivalent for single numeric questions.
Use MIN:/MAX: constraints to enforce valid ranges at data entry time.
Related