Displayr's filtering capabilities are quite robust, but it is important to take into consideration how you plan on using filters in your report before diving into configuring them. This ensures that the method you use is appropriate for the features you'd like to incorporate. Use the questions below to help determine the best way to set up your filters for your dashboard.
There are various ways that you can set up filtering in your dashboard. Some features may only work with a certain mechanism and you are able to combine the different mechanisms if you like - though typically people choose only one for consistency's sake and ease of use. The different methods are static filtering and interactive filtering.
Understanding of the following:
- What filtering is and does behind the scenes, see our Introduction to Filtering in the.datastory.guide.
- How to create and tag variables as filters in your Data Set, see How to Tag a Variable as a Filter.
- How to apply filter variables to outputs in pages, see How to Apply a Filter.
Static filtering methods
- Static filter variables - you can create filter variables to filter outputs in your dashboard. Our Create Standard Filters section lists different ways of making filters from your data. These filters are automatically shown in the the Filter(s) dropdown on outputs in Edit Mode and in the header strip in View Mode (see Page Filtering below). You are even able to customize the list of filters available to viewers of the dashboard, see How to Customize the Filter Control List in View Mode. Any static filters applied in Edit Mode to items when a document is published will be permanently applied in View Mode.
- Pre-filtered variable sets - you can create new versions of your questions that are pre-filtered as you like and use those questions in your outputs that require filtering. How to Rebase One Question Based on Another Question and How to Rebase Multiple Response Data in Variable(s) to NET are two of our popular automations for this. The first is especially helpful when you need to show data on 3 dimensions in a table, such as showing a KPI (1) per brand (2) over time (3).
Interactive filtering methods
- Page filtering - this is an embedded list of filter variables in the document and is shown in the top header of any page with outputs that can be filtered in View Mode. See How to Tag a Variable as a Filter for instructions. Page Filters look like the example below in View Mode to viewers:
Any of these available filters can be selected by the viewer in any combination, and are only applied to the current page they're on. Selecting a filter from this menu is akin to selecting that filter from the Filter(s) dropdown on all of the outputs on the page (unless it's an R-based output with the Automatic checkbox unchecked). The filter is applied in addition to any filters already applied to outputs. You can check this behavior in Edit Mode by clicking on a Page in the Pages pane and applying the filter from the Filter(s) dropdown there in the object inspector on the right. This also means that any input tables for visualizations and the like need to be on the same page as their output in order for the visualization to be filtered by the Page Filter.
- Control filtering - this method uses controls (combo box, list box, date, and text controls) shown to the viewer to allow them to dynamically change filter variable(s), which is applied to certain outputs. See How to Create a Combo Box Filter for a worked example of how to create a dropdown control filter. In the document, a control filter would look something like this:
This is the most robust method of filtering because you have more control over what outputs are filtered, you can set up the filter logic in any way you'd like (i.e. if this combo box is filled in ignore the other combo box, if this category is selected filter everything out, etc), you can share controls across pages using the Page Master so a selection "sticks" across pages, and the control does not have to be on the same page as the outputs that are being filtered.
The trade-off is that, if you want to do something different than the standard control filter, you will need to be comfortable editing R code. That said, we have lots of example code in articles in our Help Center. In addition to affecting a filter variable, you can also use controls to select specific rows/columns on many outputs directly, and add other interactivity to your dashboard, see our Work with Controls for Interactive Outputs section for other use cases.
- User Group filtering - if you Publish your dashboard as Login and password required you can use the User Group(s) a user in View Mode is assigned to filter the dashboard (see How to Filter a Dashboard Based on User Logins) and/or grant them access to certain pages in the document (see How to Partition a Document for Multiple Stakeholders). You can set page permissions without the need for R code, but if you want to create a filter variable based on User Group to apply to outputs, that will require custom R code. Setting up filtering this way is also harder to test and troubleshoot because you need to have test user logins with different permissions.
Considerations when deciding on your filtering approach
- Do you need automatically filtered exports?
These are available through the Export Pages menu and only Page Filtering is built into the tool. However, you can write some custom R code to allow you to use combo-box filters, though it may require quite a bit of custom code if you have many outputs.
- Do you need to filter multiple pages at once?
This is doable with Control-based filtering or User Group filtering. This functionality is in the long-term plan for Page Filters but has not been implemented yet.
- Do you need to filter only some of the tables on a page?
Control-based filtering or User Group filtering supports this as you can apply the filter to only outputs you want filtered. Page filters will apply to all outputs on the page (visible or hidden). If you use Calculations you can control how page filters are applied on those by unchecking Automatic on items, but this is not available on our built-in tables and some visualizations.
- Do you need different filters to show up on different pages?
Control-based filtering supports this functionality. You can configure different layouts in your Page Master with a different set of controls or add new controls/control variables to individual pages in your document.
- Do you only need certain filters available when others are selected?
Control-based filtering can do this, see How to Create a Combo Box (Drop-Down Control) With a Dynamic List.
It's important to consider what filtering type will work for you from the start to avoid reworking your dashboard later. If you're unsure how to set up filtering for your document or have any questions about your options, don't hesitate to reach out to our support team at firstname.lastname@example.org or by clicking on Help > Contact support from within your specific document in Displayr. Please provide the requirements of your filtering and what bit you need more clarification on.
Watch a filtering walk-through
See the Create and Apply Filters section for more filtering How-Tos