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.
- 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
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||
|Across variable sets||To filter based on criteria from each||
|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|
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)
|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)|
- Select the variable you wish 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 Hidden except in the data tree before you apply it to anything in your document, see How to Customize the Filter Control List in View Mode for more info.
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
Article is closed for comments.