In this article
You can define advanced filters that are based on several questions and combined these questions using AND and OR operators. These types of filters are called Filter Trees. To create an advanced filter:
- In the Filters toolbox, right-click on the Filter item and choose Insert Filter Tree from the menu .
- Rename the filter tree as appropriate, then double-click on it to open the Advanced Filter Designer page .
- Drag the questions you wish to include in the filter from the Data Source toolbox and drop them into the filter folders.
- Save the changes.
Figure 1 - Inserting a filter tree into the Filter folder
A New Filter Tree element is created in the Filters toolbox.
Figure 2 - The Advanced Filter Designer page
Two types of relations can exist between the elements in a filter: they can be linked using the AND operator or using the OR operator. These objects are available in the Components branch. Drag them as required to the filter branch. You can also define levels in advanced filters.
Example
Note: The following example is based on a fictitious survey that is intended to discover the respondent's TV-viewing preferences.
The following example describes how to build a filter on two single questions (Gender and Age), one multi question (TV Channels Today) and one grid question (Satisfied with Present Package).
The filter is required as follows:
- The first level of the filter is to be: Male respondents under 51, and who have either EuroNews or BBC World.
- In the second level of the filter, these respondents should be satisfied with News or Documentaries.
Proceed as follows:
- In the Filters toolbox, right-click on the Filter item and choose Insert Filter Tree from the menu.
- Give the new element a logical name.
- Double-click on the new element or right-click on it and select Edit.
- Drag the questions from the Data Source and drop them into the AND folder.
- To select the answer alternatives, click on the ellipses button in the lower-right corner of the page.
- In the Available Items column, select the required answer alternatives, then click the >> button to move them to the Selected Items column
- On completion, click OK.
- In the Advanced Filter Designer window, click the Update button to update the changes.
- Drag the OR folder up from Components and drop it inside the filter (drop it onto the text of the last element to insert it into the AND folder).
- Drag the q5 grid question from the Data Source and drop it into the OR folder created in the previous step .
- Save the changes.
A new filter element is created in the Filters toolbox.
The Design Advanced Filter page opens.
To insert the first element into the folder, point at the folder icon when releasing the mouse button.
To activate the Condition builder, click on the question. For single questions the operator will always be IN, and for multi questions the operators will be AND or OR .
Figure 3 - Questions dragged into the AND folder
In the figure, the filters on questions q3 and q6 have already been defined.
A new window opens, allowing you to choose the answer alternatives .
Figure 4 - Selecting the answer alternatives for a filter
All three questions in the filter are now linked together using the AND operator. The two elements in q4 are linked together using OR .
Figure 5 - Filter on q4 updated
Note: You cannot drag the entire grid question into the filter. You must expand the question by clicking on its icon, then drag the single elements .(answer alternatives) into the filter.
Example of an expanded grid question
Figure 6 - Filters defined on a grid question
The logic in advanced filters can easily be inverted, both on the elements and the folders. Inverting the logic means inserting NOT to achieve the opposite result. To do this, right-click on the folder and select Invert Logic from the menu.
You can change the AND and OR folders to the other alternative. To do this, right-click on the folder and select AND <-> OR from the menu .
Figure 7 - Changing the filter logic
Operators for Numeric Questions, Interview Start and Interview End
When defining filters on Numeric questions, Interview Start and Interview End, the Condition builder contains a number of operators.
Numeric Questions
When defining filters on Numeric questions, the operators in the Condition builder are as follows:
- = - equal to.
- <> - is not equal to.
- < - less than.
- > - greater than.
- <= - less than or equal to.
- >= - greater than or equal to.
When defining a filter on a numeric question, you must enter the Value manually .
Figure 8 - A simple numeric filter
Figure 9 - An advanced filter on a numeric question
Note: Numeric List questions must be expanded first, and the single items can then be dragged into the filter designer.
Interview Start and Interview End
When defining filters on Interview Start and Interview End, the operators in the Condition builder are as follows:
- = - equal to.
- <> - is not equal to.
- < - less than
- > - greater than.
- <= - less than or equal to.
- >= - greater than or equal to.
In addition,a calendar button is displayed next to the Value field . To define the Value for the filter, click on the button to open a calendar, and select the appropriate date.
Figure 10 - Defining a filter on Interview Start