Dashboard filters and actions in Tableau Public enable users to precisely select the information that they would like to explore, which is powerful. Selecting what's interesting makes a data story personal and relevant to users; all of this is done without shifting their attention or their mouse away from the dashboard. Filters and actions create true interactivity. They also give you, as an author, the ability to connect disparate sources of data or web pages to complete user experience.
In this chapter, we will discuss the following topics:
Filters are designed to meet several needs of your users; the following are some of these needs:
Using a filter to limit the data that is extracted into your workbook improves the performance of the workbook. However, the following are the two disadvantages of using filters on dashboards:
In this chapter, we will use the dashboard that we created in the previous chapter. You can download the finished product by visiting https://public.tableau.com/views/Chaper7-Dashboards/CO2EmissionsDashboard?:embed=y&:display_count=yes&:showTabs=y. The dashboard uses only one data source at this point. As we progress through this chapter, we'll add another dashboard along with a fourth visualization.
In the dashboard that we are using, we have already filtered the map to show only the data for 2008, which is a blue pill on the Filters shelf, because it is a discrete number. You will also see that there are green pills for Latitude and Longitude. Both of these pills are continuous numbers, and they are included on the Filters shelf because we filtered out the null values, as shown in the following screenshot:
If a field is not already on the Filters shelf, you can drag it there from the Data window. Alternatively, you can create a Quick Filter by right-clicking on it in the Data window and selecting Show Quick Filter, as shown in the following screenshot. Tableau Public will then display the Quick Filter on the upper right-hand side of the workspace, but you can easily move it around the worksheet, as shown in the following screenshot:
For instance, if a field is a part of a visualization and it's on the Rows or Columns shelf, the Marks card, or anywhere else, you can click on its Context menu and select Filter.
There is a catch to adding filters. If a field is not on the Filters shelf of a worksheet, you won't be able to add it as a filter on the dashboard. In the following screenshot, we navigated to the worksheet in the workbook that has the map on it and added the filter there. In the next section of this chapter, we will go back to the dashboard and add the Quick Filter.
To add a Quick Filter for Region, perform the following steps:
The pill for Region (which is blue because it's a discrete field) is now in the Filters shelf. When you go back to the dashboard, you can add it to the worksheet.
The other Filter tabs allow you to further specify the members that you want to retain or exclude in the analysis. You can perform the following operations:
This works particularly well in graphs other than maps because users are often only concerned with the best and worst performers.
If your worksheet is already on the dashboard, the new filter will not appear there automatically. The dashboard is laid out in a vertical column for the most part, and we do not have filters on it. Its top looks like the following screenshot:
We want to add the Region Quick Filter to the dashboard and then apply it to the other worksheets on the dashboard. When we add a filter (or a legend) to a dashboard that we have arranged very specifically, Tableau Public will automatically add a vertical layout container on the far right. Don't be alarmed by this. You can move filters and legends to the locations you want them to be in.
If a field is already a part of a visualization that is on a dashboard because it is one of the fields that is being displayed on the Detail or Tooltip shelves, you can add it to the dashboard by clicking on the Context menu for the visualization and then selecting it from the list of the Quick Filter options.
In the next few exercises, we will discuss the following topics:
In order to add and modify the Quick Filter, perform the following steps:
The other modifications that you can make from the Context menu of the filter and which add polish and specificity to your dashboard, are as follows:
Formatting the filter box so that it has a floating or fixed width is another feature that gives authors control over the appearance of worksheet.
The quick filter is still present in the vertical container to the right that Tableau Public automatically created for it. If you have several Quick Filters and Legends, it's perfectly fine to leave them in the container. Just be conscious of how you are using white space.
We plan to add a parameter later, but for now, we want to put this quick filter next to the title for the dashboard. The title is in a horizontal layout container already, which means that we can put other objects next to it.
In the following screenshot, the changes that we made to the Region filter were applied to the other worksheets to which we had applied the filter (which included all the worksheets on the dashboard):