Desktop User Guides > 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 in response to at least one question
 
Answers chosen in response to at least one question
This topic shows how to create a response list that displays only answers that were chosen in response to at least one of two earlier questions. The metadata section is as follows:
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;
MostEffective "Of those advertisements, which brand do you think
had the most effective advertising overall?" categorical [1..1]
{
use BrandList,
use OrganicBrandList
} asc;
You want the response list for MostEffective to contain only the brands that were mentioned at SawAdvert or HeardAdvert or both, so place the following statements in the routing section:
SawAdvert.Ask()
HeardAdvert.Ask()MostEffective.Categories.Filter =     SawAdvert.Response.Value + HeardAdvert.Response.Value
MostEffective.Ask()
As you can see, the response list is built using the union (+) operator that nets the answers to the two previous questions. You can net as many questions as you like to produce the response list that you need. The Did not see/hear responses are ignored when the filter is built because they are not part of the Brands shared list that is used by MostEffective. If the filter for MostEffective produces an empty list, the question is not asked.
See also
Response lists that combine answers to previous questions