Learn

If you’ve ever encountered the so-called “rainbow spinning wheel of death,” then you know what it looks like when an application or computer is struggling with the amount of work it’s been given. Obviously, that’s something we want to avoid, and luckily Tableau has built-in tools to help us manage the data load, even when working with hundreds or thousands of lines of data.

Tableau’s filter function allows us to improve performance as well as remove null values or other extraneous data points.

During dashboard development, filtering helps Tableau’s performance when adding new elements to our viz. Each time we add a pill to the view, Tableau will recalculate and redraw all the currently existing marks and elements. Filtering during development reduces the number of marks that Tableau has to redraw for each of our actions, meaning less waiting time during development.

Whenever we make a visualization that plots every individual data point, rather than an aggregate, filtering can be an important first step. We’ll see an example of this when trying to make a map of all trees in NYC, but the same principle applies to a scatterplot as well.

Let’s return to where we left off and use some filtering best practices to improve the speed of development and user interactions with our new dashboard.

Instructions

  1. Open your workbook and find the last view we created for aggregations and head to the CountD worksheet. This tab should show a horizontal bar chart of CNTD(TreeID) and Borough Name.
  2. The Health field will give us the status and health of each tree. It also provides a good filter, since we can choose to only show trees of one status. Drag Tree Health to the Filters Shelf and select Good. Tree Health Pill Now all the counts are filtered for only trees in good health. To further improve performance or develop a visualization quickly, we can add additional filters.
  3. Now let’s make a map to see how much filters help when we have a lot of data points. Open a new worksheet in your workbook and name the sheet “Tree Locations”.
  4. Add Longitude and Latitude measures to the view by double-clicking on each field name. You should see a map with a single point that represents the average of all the latitude/longitude values for each tree.
  5. We can see the latitude and longitude for each tree by adding the Tree Id to the Detail shelf. Tableau will ask if we’re sure we want to add all values. If we choose Add all members, this will almost certainly take some time for Tableau to render. (Depending on the processing power of the computer and the size of the dataset, this choice might require restarting the program.) There are almost 700,000 individual trees in our dataset and Tableau will create a point for each of them! Anything that we changed in the view would take even longer to render as well.
  6. So let’s reduce that wait time by adding a filter. Pull the Borough Name field to the Filters shelf and make a single selection to show just one Borough at a time – try Bronx. Now any development we do, whether adding color or looking at Tree Health on the map, will be much quicker to load, since we’ve reduced the number of marks from almost 700k to about 85k. Try pulling Tree ID to the Detail card and dragging Tree Health to the Color card. The map won’t be very readable yet, but we’ll tackle that in the next lesson! (You may have to wait up to a couple minutes for this to load – if you want things to move faster or are concerned about your computer’s processing power, filter by a few Zip Codes instead of Borough Name to further reduce the number of points you’re plotting.)
  7. We can either leave this filter on and have the user make a single selection, or we can open it up to their choice once the visualization is done. This last part is a powerful interactive tool in Tableau: allowing users to interact with our visualizations by changing the filtered view they see. Giving filtering access to our end user requires just one step:
  8. In the Filters Shelf, click the dropdown on the Borough Name pill and select Show Filter. This will add a window with a selectable checkbox on the view, allowing viewers to change the filter on the visualization. There are still a lot of data points in each borough, which makes this map a little hard to interpret. In the next lesson, we’ll learn how to improve our visualizations so that they communicate effectively and beautifully!

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?