This article describes how to apply a filter to output(s) or page(s) in Displayr. Filters will remove respondents from being taken into account when creating the output. Filter variables should be applied to items which handle the raw data directly. For example, if your visualization is hooked up to a table through Output in 'Pages', you should instead apply the filter to the table itself as the visualization is merely referencing the already calculated numbers from the table. Filters (as well as other items configured in the object inspector of an output) only apply to the output and do not change the individual Variables' data in the Data Set.
This article contains the steps required to apply a filter to the table and chart as shown below...
...to a state where both the table and chart are filtered to show only the respondents aged between 18-39.
- Familiarity with: Introduction to Filtering and creating/formatting filters in How to Tag a Variable as a Filter.
- A Displayr document containing a data set.
- A filter variable. See: How to Tag a Variable as a Filter
- An output (e.g., table or chart) to filter.
Method 1 - Applying filters in edit mode
- In Edit mode, select the output(s) or page(s) you wish to filter. If you select an entire Page, all items on the page that have the Filter(s) dropdown available in their object inspector will be filtered.
- Go to the object inspector > Inputs > FILTERS & WEIGHT > Filter(s) and select the filter variable(s) you wish to use. Once selected the filter variable(s) will appear in green. These filters will be the filters applied to the output permanently in View Mode of a dashboard. For more dynamic filtering, see How to Create a Combo Box Filter.
If you select multiple values from the same variable set (e.g., 18-24 and 25-29) the output will be filtered to all respondents matching either of the conditions (18-24 OR 25-29). It's also possible to select multiple variable set, in which case the output will be filtered to match all filter selections (e.g. 18-24 AND Female).
Method 2 - Applying filters to Pages in View Mode
- In View mode, select the page you wish to filter.
- Go to the Filter menu at the top of the published document and select the desired filter(s). All items on the page that have the Filter(s) dropdown available in their object inspector will be filtered.
Method 3 - Applying filters to individual items in View Mode.
The only way to have the a Page filter (method 2 above) NOT filter an output in view mode, is to make it an R-based output and uncheck the Automatic checkbox on the item, see How to Control Which Calculations are Filtered in View Mode. When being more selective in filtering outputs in View Mode it's more typical to use Controls instead of Page filtering, see: How to Create a Combo Box Filter and How to Create a Combo Box (Drop-Down Control) With a Dynamic List.
For more design ideas, see How to Setup Filtering in a Dashboard.
For more niche filtering examples, see our section for Create and Apply Filters.
For a video guide walkthrough, see Filtering Data