Introduction to Tableau and Data Visualization
)}

Context Filters

We will explore the concept of context filters by building a plot which analyzes the sales of subcategories in 2011.

Drag Order Date and Sub-Category to the rows shelf, and Sales to the columns shelf.

The next step is to filter the view based on the year. As always, drag the field that you want to filter by to the filter shelf, and only show values for the year 2011.

Your next step is to filter the top 5 office supply sub-categories with the most sales.

What if we simply drag sub-categories into the filters shelf, choose top 5 by the sales field?

Then, what if we dragged Categories to the filter shelf, and filtered everything but office supplies?

Uh-oh! The result of this is a single office supply sub-category, even though we asked for top 5. What happened?!?!

This is expected since all of these filters are independent of each other. Each filter reads all the rows in the data source without regard to the other filters and creates its own result. In our case, the sub-category filter selects the top 5 sub-categories based on the entire data source

If I were to now add the category filter which removes everything that's not an office supply, it would only show storage as it is the only office supply within that list of values.

We need to specify an order such that the Categories filter starts by removing all subcategories that are not office supplies, and then have the sub-category filter only process that data.

To do this, right click on category, and choose add to context.

There you go! This is a common case, where we have a second filter that depends on the values returned by the initial context filter.‍

Feedback Summary
5.0
1 students
5

100%
4

0%
3

0%
2

0%
1

0%
Written Reviews
There are no written reviews yet.