Using filters to find a subset of respondents

Snap provides filters that you can use to limit the data that you are displaying or analysing. You can filter data so that:

  • it only includes the people you want (for example, creating a pie-chart showing the sports preferences of Canadian men between ages of 25 and 35)
  • it does not include the people you don't want (for example, excludes all men who like ice-hockey)
  • it only includes people who have done things on a certain date or time (for example, watched ice-hockey in November)

This worksheet assumes that you have run a promotion at a restaurant and are considering running another. It describes how to filter people who have completed a survey in a certain week (when the promotion was running) to see what effect the promotion had. It also describes how to examine the demographics of people who have left comments, as you want to see if that affects the type of comments they leave.

Background

Snap filters allow you to limit the data you look at. The most obvious example is on a dating site, when you specify that you are only interested in men between 25 and 30. You are filtering the people on the site by sex and age.

In the same way, you can filter the respondent data that you use in your analyses. You can filter it by their answers to one or more of the questions. You can also filter it by respondents who did or did not reply to certain questions, for example, you could select all respondents who wrote a comment.

You can filter on the value of a question response or on data that Snap provides. The way you filter may be different depending on the type of question.

  • filter multi-response values on which code(s) people have selected. You can also filter on how many codes people have selected.
  • filter quantity questions by whether the value is larger, smaller, or equal to another value.
  • filter by the date or time, or on parts of them such as month, day or hour
  • filter text questions on whether the text has been entered, or whether it contains particular words or parts of words
  • filter cases by case number

You can also combine filters together using Boolean logic. You may have come across this when using Google or eBay searches.

If you want to find either of two options, then you use the word "OR". For example, (q7=1) OR (q8=2) finds all the cases where respondents responded 1 to q7 or responded 2 to question 8.

If you want to find cases where respondents responded 1 to q7 and 2 to question 8 filter using (q7=1) AND (q8=2).

If you want to find cases where respondents responded 1 to q7 and didn't respond 2 to question 8 filter using (q7=1) AND NOT(q8=2).

Summary of steps

This worksheet uses the Satisfaction survey supplied with Snap. It shows you how to create satisfaction charts for a two month period by applying a filter. It then shows you how to create a list of comments together with the sex and age of the person making the comment, using a filter to exclude cases without comments.

Step1: Creating a chart showing satisfaction in July and August

This assumes that you had a special promotion on food during September and October. You're going to create three satisfaction graphs; one with data for July and August, one with data for September and October, and one with data for November and December, so you can easily see the effects of the promotion.

  1. Open the survey snSatisfaction provided with your copy of Snap. This survey includes sample responses. If the survey is not available on your computer you can download a zip file containing the survey and the responses here.
  2. Click Chart button on the Snap toolbar to create a chart. The Results Definition dialog appears.
  3. Select Horizontal Stacked Bar 2D Labelled as the Style. This creates a bar chart showing the proportions of people who selected each response.
  4. Enter Q4.a TO Q4.e in the Analysis field. This shows the different levels of satisfaction with different aspects of the service.
  5. Click Transpose so you display the responses by question rather than by value.
  6. Enter Q1.a MONTH=(7 OR 8) in the Filter field.

    Q1.a is the question asking which date they visited

    MONTH is a date function which picks the month out of a date as a number

    =(7 OR 8) compares the month number pulled out by the MONTH function to 7 or 8 (July or August) and keeps the cases where this is true.

  7. Click the Notes/Titles tab and enter a title such as Satisfaction ratings for July and August.

    RD: crop satisfaction title

  8. Click [OK] to create the chart. It will look something like this:

Stracked bar chart showing July August satisfaction

Click Save button on the chart toolbar to save your chart.

Step 2: Creating charts showing satisfaction in other months

  1. Click Chart button again to open the Results Definition dialog.
  2. Select Horizontal Stacked Bar 2D Labelled as the Style if it is not selected.
  3. Click the Scroll down arrow button at the right-hand end of the Analysis field and select Q.4a TO Q4.e in the drop-down list of recent entries.
  4. Check Transpose.
  5. Enter Q1.a MONTH=(9 OR 10) in the Filter field. This only uses data gathered in September and October.

    RD: cropped def os satisfaction months 9 to 10

  6. Change to the Notes/Titles tab and enter a suitable title.
  7. Click [OK] to see your chart.

Chart: Stacked bar showing satisfaction sept oct

You can see that the levels of satisfaction with the quality and choice of product have increased.

Step 3: Creating a list of people who have made comments

This step shows you how to create a list of comments, together with the sex and age of the person making the comment.

  1. Click the Toolbar: list on the Snap toolbar to open the Results Definition dialog for a list.
  2. Enter case, q6, q8, q7 in the Analysis field. This tells Snap you want the list to show the case number, the comment, the sex and the age of the respondent.
  3. Enter q6 OK in the Filter field. This specifies that you only want to see cases where a comment has been entered. (You could also use NOT q6 NR to specify cases which do not have a "No reply" to q6.)

    Note that you can use capital or lower case letters for question numbers in the Analysis and Break fields.

    RD: list showing comments with an ok filter

  4. Click [OK]. The list is displayed. You can see from the case numbers that cases have been omitted if they do not include a comment.

    List: cases with comments showing sex and age

Conclusion

This worksheet has shown two simple filters, one selecting data cases that had been entered in specific months, and one showing data cases that had an answer to a specific question.

Filters can be used to set up charts of different data instead of using a cross-tabulation. For example, use a time filter to produce two charts, one showing morning data and one showing afternoon data, instead of creating a derived variable to create a cross-tabulation showing both sets of data in the same table.

You can also use filters when exporting data, or when displaying data in the survey summary. For further information see Browsing case data using a filter in the User Manual or the online help

You can use filter expressions when specifying what data to use in a derived variable. For further information see Example of setting up a variable for a complex filter in the User Manual or the online help.

For a complete reference of filter expressions see the topics Filter examples and Filter expressions in the Reference Manual or the online help.

For more information about using date and time expressions in filters, see the topics Date Functions and Time Functions in the Reference Manual or the online help. Note that you can use the standard filter operators to compare dates and times as well as using the special functions.