logo SmartSurvey / Scripting Docs
Back to Docs
Question Type
13 List Numeric Numeric *NUMLIST

Captures multiple numeric values in a fixed-label list format using *NUMLIST. Each numbered slot has a predefined label and accepts a single numeric entry. Commonly used for expenditure breakdowns, allocation questions, or any scenario where the respondent must enter a number against each of a fixed set of categories. Use *MANDATORY on any slot to force an entry for that row. Use sumof[] to total all entries or valueof[Qx.n] to access a specific slot.

Type ID 13
Directive *NUMLIST
Category Numeric
Script Definition
script definition (.q)
-- Basic *NUMLIST: each numbered slot has a label and accepts a numeric entry.
-- *MANDATORY on a slot forces the respondent to fill in that row before advancing.
*QUESTION Q13 *NUMLIST
Q13. Enter monthly spend for each brand (BDT)
1:Food *MANDATORY
2:Transport *MANDATORY
3:Education *MANDATORY
4:House Rent *MANDATORY
5:Others *MANDATORY

-- When all slots are *MANDATORY, the respondent must fill every row.
-- This is appropriate when all categories are expected to have a value,
-- including zero (e.g. 0 for a category with no spend that month).
-- If some categories may genuinely be blank, remove *MANDATORY from those slots.

-- Validating numeric input range using *MIN and *MAX:
-- Append *MIN value and *MAX value to a slot to restrict the acceptable
-- numeric range for that entry. The respondent cannot advance if the entered
-- value falls outside the defined range for any *MANDATORY slot.
*QUESTION Q13 *NUMLIST
Q13. Enter monthly spend for each brand (BDT)
1:Food *MANDATORY *MIN 100 *MAX 5000
2:Transport *MANDATORY *MIN 50 *MAX 2000
3:Education *MANDATORY *MIN 1000 *MAX 4000
4:House Rent *MANDATORY *MIN 3000 *MAX 15000
5:Others *MANDATORY *MIN 0 *MAX 5000

-- *MIN and *MAX are applied per slot independently.
-- Each category can have its own realistic range based on domain knowledge.
-- Setting *MIN 0 on Others allows a zero entry (no spend) while still
-- being *MANDATORY, so the respondent must actively confirm the value.
Use in Expressions
expressions
sumof[Q13]>=5000        -- total monthly spend is 5000 BDT or above
totalof[Q13]=5          -- all 5 slots were filled
valueof[Q13.1]>=1000    -- Food spend is 1000 BDT or above
valueof[Q13.4]>valueof[Q13.3]   -- House Rent is more than Education spend
*NUMLIST presents each numbered slot as an independent numeric entry field with a fixed label. Unlike *ALPHALIST (text), each entry must be a valid number.
Why *MANDATORY? Appending *MANDATORY to a slot forces the respondent to enter a numeric value (including 0) for that row before advancing. In expenditure questions where every category must be accounted for, apply *MANDATORY to all slots so no category is accidentally left blank.
sumof[Q13] adds all numeric entries together. totalof[Q13] counts how many slots were filled. Use sumof[] for totals and totalof[] for completion checks — do not confuse the two.
Use valueof[Q13.n] in come-logic or check conditions to route or validate based on a specific slot. For example, valueof[Q13.5]>0 checks whether the respondent entered any spend under Others.
Why *MIN and *MAX per slot? Each *NUMLIST slot can have its own acceptable range independent of the others. *MIN sets the lowest accepted value and *MAX sets the highest. If the respondent enters a value outside this range, they are shown a validation error and cannot advance until the value is corrected. This prevents unrealistic entries such as a House Rent of 1 BDT or a Food spend of 500,000 BDT.
Set *MIN 0 on optional-spend categories like Others so the respondent can legitimately enter zero without triggering a validation error, while still keeping *MANDATORY to ensure they actively confirm the figure.
Respondents must enter a numeric value. Text or blank entries are rejected at the slot level. Instruct respondents to enter 0 for categories with no spend rather than leaving them blank when *MANDATORY is applied.
Related