Filters allow report consumers to explore analysis on their own without having to modify the underlying query or report logic. Filters are applied to a report after all the SQL has executed, so they’re fast and don’t require the report to be re-run when they’re applied. Mode reports offer various types of filters that you can add at either the report or the individual visualization level:
- Date range
- Number range
When you add a filter to a report or visualization, Mode will choose the appropriate filter type based on the type of data that is being filtered. You can change the filter type by clicking on the settings icon.
A report must be run before report filters can be applied. Only users with edit access to the report can create report filters, but all report viewers can use filters in the report view.
Add a report filter
If your report includes queries with duplicate column names, applying a corresponding filter will filter all columns of that name.
- In the Report Builder, click Add Filter.
- You’ll see a list of all columns in all queries in your report. Select one to filter and click Add.
- The report filter panel will appear on the right side of the Report Builder, including the filter components, Set Default option, and Filter Settings.
- To adjust the settings on a particular component, hover over the component and click the Settings icon. In settings, you can change the filter type, update the position of each component, include null values, reset the report filter, and delete the component.
- Click Add Filter to include additional components to the filter panel.
- Once your report filters are set up, click Apply.
- To set a custom default range on a report filter, click Set as Default.
- Close the report filter panel by clicking the Filter icon.
Using report filters
- Click the Filter icon in the Report View, located on the right side of the header.
- Choose your filters and click Apply.
- All relevant visualizations will update to reflect the new filter configuration.
While a report editor can set default values for the filters in a report, any changes to those values by report viewers will not persist from session to session or for other viewers.
Report filters vs. parameters
Filters and parameters can both add interactivity to reports, but they serve different purposes depending on your needs. Reports can have both filters and parameters.
When using parameters, report viewers are essentially modifying the data that gets loaded into a report by modifying the underlying query; this requires re-running the report’s queries. Analysts need to write their parameter fields directly into their queries. Report filters, on the other hand, impact the data once it’s in the report (by narrowing down the results) and don’t impact how queries are run. As a result, they’re faster to add and only require a few clicks in the Report Builder.
In most cases, you’ll want to use report filters instead of parameters because they’re faster to build and faster to use, making it easier for viewers to quickly iterate through ideas. When your data set is massive (like an event stream), a parameter can be used to load a reasonable amount of data into the report.
While report filters affect all visualizations in a report, visualization filters are applied only to a specific visualization.
For example, say there is one query in the report which powers both a line chart that visualizes sales trends over time, and a pie chart that visualizes the breakdown of sales per region. By adding the column sell_date as a report filter and excluding the year 2015, both charts will update with data from the excluded year.
Using the same query, if we want the line chart to reflect data from 2016 and 2017, while the pie chart shows data from all years, we’ll need to apply a visualization filter to the line chart instead.
Adding a visualization filter
Any column returned by queries can be added to a chart as a visualization filter. These filters can be applied to: bar, grouped bar, line, line + bar, area, 100% area, scatter, pie, and donut charts. To create a visualization filter:
- Select a chart type.
- In the chart settings, drag and drop a measure or dimension into the Filters drop zone.
- A moveable window will appear with the filter selections. Select the desired filter and click Apply to see the selection reflected on the chart. Use Reset to return to the last applied state.
- When ready, click OK to apply the visualization filter.
- To edit or remove a visualization filter, click the down arrow to access the context menu.
Using visualization filters in the report view
Report viewers can enter the expanded view for an individual visualization to explore the data behind it in depth:
- In the top-right corner of a visualization in the report view, click on the rocket icon to enter the expanded view.
- Drag and drop items into the Filter drop zone. To learn more about exploring data visually, read the doc.
- Press the escape key or click on the collapse icon to close the expanded view and return to the report.
No changes made by viewers in the expanded view will permanently affect the underlying report, nor will they persist from session to session.
How are columns grouped in report filters?
Columns with the same name (and datatype) across multiple queries are automatically grouped into a single field. This will allow filtering across the entire report and the corresponding visualizations. To disassociate the columns with the same name, simply rename them using an alias in the query.
What happens if a column name is changed?
When a column is re-named, the report filter will no longer effect the column. However, if the column name is reverted, the filter will work again as long as the association between the filter and the query-column is not removed.
What happens to a report filter when a query gets deleted?
If the query that a report filter is associated with gets deleted, the report filter will continue to exist but will not have any impact on the data in the report. You can delete the report filter from the settings dropdown.
Do report filters work with embeds?
Yes, report filters work with all embed types, including White-Label Embeds.
Do report filters apply to Notebook output cell results or custom HTML?
Report filters currently do not affect Notebook output cells or custom HTML in reports.
Last updated May 17, 2018