Filtering and Formatting

Interactive filters will allow our viewers to explore the data and engage with the visualization. We added one for Category to our map, but it currently only filters the map. We also want to use the map itself as a filter and to format the titles of our worksheets.

Learning Objectives

  • Use a worksheet as a filter.
  • Apply a worksheet filter to an entire dashboard.
  • Add filters to context to fix filter ordering issues.
  • Hide or change worksheet titles on a dashboard.

Turning a Worksheet into a Filter

In Tableau, it is possible to turn a whole worksheet into a filter for a dashboard. If we make Map a filter, then clicking on a country will filter the data to only display mods from that country. This way our map will not only provide information, but also serve as a filter at the same time.

Start by clicking on the Map tile if it is not already selected. At the top left (or possibly right, depending on your arrangement of tiles), there will be a small list of options starting with an X and ending with a downward arrow. Just above the arrow is a funnel icon. Hovering over it produces the text: Use as Filter. Clicking on this will turn the map into a filter.

Funnel icon to use _Map_ as filter

If you hover over the downward arrow below the funnel icon you will see the text: More Options. Clicking on this arrow will open up a dropdown menu where one of the options is Use as Filter. This does the same thing as clicking the funnel icon.

Dropdown to use _Map_ as filter

Applying a Worksheet Filter to a Dashboard

While we were able to turn the map into a filter, this did not connect the Category filter to the rest of the dashboard. We will have to do that ourselves.

  1. Click on the Category filter and note the list of options on the top left or top right. This will be shorter than the map's list: Only an X and an arrow.
  2. click on the arrow for More Options.
  3. Choose Apply to Worksheets -> Selected Worksheets. This will allow us to decide which worksheets we will apply the filter to. Note that Only This Worksheet was the previous selection. Applying Category filter to worksheets
  4. In the window that pops up, click the button for All on dashboard. It will automatically check the boxes for each of the worksheets listed. We could check each box manually, but this option is more convenient. Apply Filter dialog box - applying Category filter to all on dashboard
  5. Click OK.

Filter Issues

We should probably test the filters we added to make sure they are working as they are supposed to.

  1. Pick a category from the Category filter. I chose Models and Textures.
  2. Click on a country on the map. I clicked on the USA.
  3. Top Tags is behaving strangely. With the filters I chose there are only nineteen tags displayed. They are also no longer in order. Testing category and map filters

How did this happen? This issue is caused by having multiple filters that are not being applied in the order we would prefer. Leave the dashboard and go to the Top Tags worksheet and look at the Filters shelf. We added the Tag filter when we made the worksheet, but the other two filters are new - one for the Category filter and one from the map.

This is what is currently happening: The top tag filter is applied, and the twenty tags are sorted in decreasing order. Then the country and category filters are applied. This changes the size of the various bars and may even eliminate one entirely. Because the top twenty have already been filtered and sorted, the remaining tags are left in their original order.

Fixing Filters for Top Tags

We want to pick the top twenty and sort the tags after applying the category and country filters. To do this, we will need to add both of these new filters to context.

  1. Right click on the Category filter on the Top Tags Filter shelf.
  2. Choose Add to Context. The filter will change from teal to gray. Adding Category filter to context of Top Tags worksheet
  3. Do the same thing for the Action(Country) filter. The Filters shelf should show Action(Country) and Category as grayed out. The final filter, Tag should still be teal, as it has not been added to context. The _Top Tags_ **Filters** shelf
  4. Go back to the dashboard. Top Tags should now show twenty sorted tags. Testing category and map filters - success

Fixing the Category Filter

We have fixed Top Tags, but we still have an issue. Clicking on the Category filter reveals that the second option (just below (All)) is Null. This is particularly distressing after all the work we did to add a null category filter and only display relevant values in the filter.

Category filter with Null option

To illustrate why we do need to fix this, try selecting Null. While their stats are displayed in the bar chart and scatter plots, the map goes completely blank. Leaving Null available to our viewers does not seem like a good option.

Choosing _Null_ Category value

Fortunately, we can fix this issue the same way we fixed Top Tags.

  1. Change the category in the filter back to Models and Textures. (Filtering on Null seems like a bad idea when we are about to remove the option to filter on Null).
  2. Go from the dashboard to the Map worksheet.
  3. Right click on Category(null filter) and choose Add to Context. The **Filters** shelf for _Map_ with _Category(null filter)_ added to context
  4. Go back to the dashboard and verify that Null is no longer an option.

Formatting Titles

Before we call our dashboard done, we should probably format a couple of the worksheet titles. Endorsements and Approval Ratio are useful and informative, but Map is rather pointless, and Top Tags could stand to be more informative.

  1. Right click on the Map title and choose Hide Title. Hiding _Map_ title
  2. Right click on the Top Tags title, but this time choose Edit Title.... Currently it is using the worksheet title as the title for the dashboard, but we can have it display any text we want.
  3. Change the text to: Top Tags by Number of Mods. Editing _Top Tags_ title
  4. Click OK.

We are now ready to move on to the finishing steps of the tutorial.