Professional > Interview scripting > Writing interview scripts > Filtering questions and response lists > Filtering categorical response lists > Response lists that combine answers to previous questions > Answers chosen at only one question
 
Answers chosen at only one question
You can filter a response list so that it contains answers that were chosen at only one of a set of questions. As an example, suppose that the metadata section defines the following questions:
BrandList define
{
Alpine, Finborough, Alsace,
DairyFresh "Dairy Fresh",
CountryFayre "Country Fayre"
};
OrganicBrandList define
{
HelenBradley "Helen Bradley's",
KentishFarm "Kentish Farm",
NaturesWay "Nature's Way Organic",
SimpleOrganix "Simple Organix"
};
SawAdvert "Which of the following brands have you seen advertised
during the last four weeks?" categorical [1..]
{
use BrandList,
use OrganicBrandList,
SawNone "Did not see any brands advertised" excl fix
} asc;
HeardAdvert "Which of the following brands have you heard advertised
during the last four weeks?" categorical [1..]
{
use BrandList,
use OrganicBrandList,
HeardNone "Did not hear any brands advertised" excl fix
} asc;
OnlyOne "For the brands for which you either saw or heard advertising,
but not both, which brand had the best advertising?" categorical [1..1]
{
use BrandList,
use OrganicBrandList
} asc;
To create a response list that contains brands for which advertising was either seen or heard but not both, the routing is as follows.
OnlyOne.Categories.Filter = SawAdvert.Response.Value / HeardAdvert.Response.Value OnlyOne.Ask()
The script uses the difference (/) operator to collect answers that were given to one question but not the other. If the filter for OnlyOne generates a blank list, the question is not asked.
See also
Response lists that combine answers to previous questions