Professional > Interview scripting > Writing interview scripts > Shared lists > Subheadings with shared lists > Sorting responses with subheadings
 
Sorting responses with subheadings
Subheadings affect the way that responses in a list are sorted or reordered. If you place an ordering keyword at the end of the question definition, the interviewing program applies it to the subsections only. The responses within a subsection (that is, under a subheading) remain in their subsections in the order they were defined. For example, if the question is defined as:
PlainKnow "Which brands of natural yogurt can you name?"
categorical [1..]
{
use BrandList sublist "Non-organic brands",
use OrganicBrands sublist "Organic brands"
} rot;
the interviewing program displays non‑organic brands followed by organic brands for one interview, and then organic followed by non‑organic for the next. The individual brand names move with their subheadings.
To reorder the responses under a subheading, do one of the following:
Put the ordering keyword at the end of the use statement, after the sublist clause.
Put the ordering keyword after the } (curly brace) that terminates the subsection in the define statement.
See also
Subheadings with shared lists