When creating a visualization in the visualization canvas, you have the option to add filters via the quick filter bar.
Filtering a visualization will change the data that is in both the chart or map as well as the data table underneath.
Note: The same filtering settings and options are also available for the Global Filter Bar in Stories.
Dependent Filters
When adding multiple column filters to a dataset, column filters are dependent on the results from the other filtered columns. For example, I add a filter for Neighborhood and include only Queen Anne. Then I add a second filter for Police Precinct. The second filter will only show precincts that operate in Queen Anne.
This is also useful when hiding a filter from end users; they will no longer be able to select additional values for data that does not exist in the dataset.
Add a filter
To add a filter to your visualization, select the Add Filter button located in the Filters panel on the right-hand side of the page. This will open up a panel where you can select any column in your dataset and use it as a filter.
You can add as many filters to your visualization as you would like and configure each one in a way that works best.
Filter Options
There are a number of different options for each filter. These options can be accessed by selecting the vertical ellipsis to the right of the column.
Multiple Values vs. Single Value
This setting allows you to specify the number of values that a column can be filtered on. Setting this value to Multiple will allow users to choose a number of different text values, or a range of numerical values.
Setting it to Single value will limit you to a single text or numerical value.
Hidden vs. Interactive
Viewers of your visualization cannot add or remove columns to filter on. In addition, you can choose whether the filter that you have added is usable by the viewer.
When Interactive viewers can apply different values within the filters you have set up. You could also not apply any values to the filter at all, simply adding it for users to filter as they wish. Choosing Hidden will completely remove the filter from the published view.
Different types of filters
The operations you can perform on a filter vary based on the datatype of the column selected.
Text
Text columns values can be pulled in using an autocomplete function. Simply start typing your value and results from the dataset will appear in the filter window.
Selecting the dropdown next to the column name will bring up the list of functions available on text columns: is, is not, starts with, contains, does not contain.
Number
Numerical data can be filtered with a number of different operators. As seen below the full list of available operations are: exclude missing values, is equal to, is not equal to, is less than, is at most, is greater than, is at least, is between, is between and includes.
Location
You can also filter on a location column to show only points that fall within a certain radius. You can search by address to enter an address that would be found on the map, this bar will autocomplete to a list of available addresses.
From there You can use either the slider bar or the text box to choose the radius in miles to filter your results.
Region (Spatial Lens) Filtering
If you have a Spatial Lens configured on your site, you can use those boundaries to filter data in visualizations and maps built from datasets with a georeference column (i.e., location/point data). When creating a visualization based on an eligible dataset, you will see a "Region" option in the filter pane, which lists the Spatial Lens boundaries available for filtering. When you select a boundary, the data displayed on your visualization will be filtered down based on whether the location data falls within the selected boundary.
Dates
Dates can be filtered two different ways, by selecting a distinct range or choosing a relative date period.
Range
This option will allow you to select a distinct inclusive set of dates to filter your dataset. For example, this would be useful if you wanted to look at a single year.
Relative Date
Choosing a relative option will allow you to show a set number of completed periods based on the options you select. You can choose between days, months, quarters, calendar years, or fiscal years as well as some preselected options.
Note: Quarters are still defined by the calendar year and cannot be customized (i.e. Q1 = January-March, Q2 = April-June, etc).
The list of preselected options includes:
-
Today
-
Yesterday
-
This
-
Week, Quarter, Month, Year (Calendar), Year (Fiscal)*
-
-
Date to Today
-
Last…
-
Days, Months, Quarters, Years (Calendar), Years (Fiscal)*
-
*Note: Don’t have Fiscal Year as an option? Site administrators will need to enable it! Click here to learn more.
When using relative date filters, only completed time periods would be included. For example, let's say today is March 9, 2022.
Note:[
meaning inclusive, )
being exclusive
Today |
[12:00 am March 9 to 12:00 am March 10) |
Starts at 12:00:00 AM on the current day and continues for 24 hours. |
Yesterday |
[12:00am March 8 to 12:00am March 9) |
Starts at 12:00:00 AM on the day before the current day and continues for 24 hours. |
This week |
[12:00 am Sunday March 6 to 12:00 am Sunday March 13) |
Starts at 12:00:00 AM on the first day of the current week, Sunday, and continues for seven days. |
This month |
[12:00 am March 1 to 12:00 am April 1) |
Starts at 12:00:00 AM on the first day of the current month and continues for all the days of that month. |
This quarter |
[12:00am January 1 to 12:00am April 1) |
Starts at 12:00:00 AM on the first day of the current calendar year quarter and continues to the end of the quarter. |
This year (calendar) |
[12:00 am January 1 2022 to 12:00 am January 1 2023) |
Starts at 12:00:00 AM on January 1 of the current year and continues through the end of December 31 of the current year. |
Last 5 days |
[12:00 am March 4 to 12:00 am March 9) |
Starts at 12:00:00 AM n days before the current day and continues up to the last completed day. (The range does not include today.) |
Last 5 months |
[12:00 am October 1, 2021 to 12:00 am March 1, 2022) |
Starts at 12:00:00 AM on the first day of the month that started n months before the current month and ending 12:00am on March 1st. (On the last day of the last completed month). |
Last 5 quarters |
[12:00 am October 1 ,2020 to 12:00am January 1 2022) |
Starts at 12:00:00 AM on the first day of the calendar quarter that started n quarters before the current quarter and continues up to the end of the last completed quarter. |
Last 5 years (calendar) |
[12:00 am January 1, 2017 to 12:00 am January 1, 2022) |
Starts at 12:00:00 AM on January 1, n+1 years ago. The range ends on January 1 of the current year. |
March 1, 2022 to today |
[12:00am March 1, 2022 to 12:00 am March 10) |
Starts at 12:00:00 AM on March 1 and continues through 12:00:00 AM March 10. |
This year (fiscal) |
[12:00 am October 1, 2021 to 12:00 am October 1, 2022) |
Starts at 12:00:00 AM on the first day of the current fiscal year and continues through the end of the last day of the fiscal year. The fiscal year start month and day is defined on admin/stories_visualizations. |
Last 5 years (fiscal) |
[12:00 am October 1, 2016 to 12:00 am October 1, 2021) |
Starts at 12:00:00 AM on the first day of the fiscal year n fiscal years ago and continues through the end of the last day of the fiscal year before the current fiscal year. (The range does not include the current fiscal year.) The fiscal year start month and day is defined on admin/stories_visualizations. |
FAQ:
Q: Can I add multiple filters on the same column?
A: No you can only create filters once on a column. This most commonly comes up with numerical data. For instance, if you want to visualize two different ranges (i.e. 1-10 and 90-100). The best way to approach this is to create a filtered view of your dataset and base your visualization on that view.
Comments
Article is closed for comments.