This article describes how to set any non-text variable as a filter that can be used to filter outputs in Displayr. Variables that are tagged as a filter are shown in the page Filter dropdown in the header strip in View Mode of a Document (known as page filtering):
and can be used in the FILTER(S) & WEIGHT > Filter(s) dropdown in Edit Mode to filter outputs in the Document.
Requirements
Please note these steps require a Displayr license.
- A Data Set with at least one non-text variable.
- Your variable to be in the appropriate format for the type of filtering you want to do. Cases that have a value of more than 0 are included in the filter. You may need to modify your data to get it in the appropriate format for filtering, see the Required Data Format section below, otherwise, you can use the Method to tag variables as filters directly.
Required Data Format
Use this table to convert your variable into the required format for the type of filtering you want:
Your filter data is: | You want: | What to do: |
A Nominal variable (categorical) | A filter variable for each category | How to Create a Binary Filter from Selected Data |
A Nominal variable (categorical) | A filter to filter in respondents who left any response | Assuming responses are coded with values above 0 - do Method below |
A Nominal or Nominal-Multi variable | A filter to filter in respondents who left SELECT responses (such as a Top 2 Box) | Change Structure > Binary-Multi, in Values > Count This Value for select categories - do Method below |
A Binary-Multi variable | A filter for each variable | Do Method below |
Across two variable sets |
Each variable in a set rebased according to matching variables in the other variable set OR Expand each category/variable in one variable set filtered by each category/variable in the other variable set |
How to Rebase One Question Based on Another Question |
A variable set | To filter based on criteria |
How to Create a Simple Filter or Use R Code to Create a Filter or Use JavaScript Code to Create a Filter |
Across variable sets | To filter based on criteria from each |
How to Create a Complicated Filter or Use R Code to Create a Filter or Use JavaScript Code to Create a Filter |
Date/Time | To filter in a specific range or the most recent X periods | Configure in the Date/Time > Period type using a Date range or Duration - do Method below |
Numeric |
To filter in data based on a calculation across respondents or value of another variable set (note if the calculation is across variables for each respondent, you can create a variable for the calculation, How to Perform Mathematical Calculations on Variables, then use that to create Create a Filter) |
Use R Code to Create a Filter or Use JavaScript Code to Create a Filter |
Binary-Multi (Compact) or Nominal-Multi | A filter for each category/response (this will be a NET of the response across the variables in the set) | Change Structure > Nominal - Multi and use TRANSFORMATIONS > Binary Variable(s) |
Method
- Select the variable you'd like to use as a filter from the Data Sets tree.
- In the object inspector, check Properties > GENERAL > Usable as a filter.
- [OPTIONAL] If you don't want the filter to be available for viewers, check the Hidden in View Mode Filter menu box before you apply it to anything in your document, see How to Customize the Filter Control List in View Mode for more info.
Next
How to Customize the Filter Control List in View Mode
How to Create a Combo Box Filter
How to Create a Complicated Filter
How to Create a Binary Filter from Selected Data
How to Use R Code to Create a Filter Based on Single-Response Questions