read

Our fictional bike store company has requested a dashboard for which they can easily look at revenue by several variables. Starting in PostgreSQL, I extracted the necessary data from 8 different tables within a relational database. Taking that data over to Tableau, you can see the interactive dashboard embedded below.

###########



Dashboard Design: Tableau Filters and Elementary School Math


As you can see, the entire dashboard can be filtered by year as well as by state. Separately, the Top Customers chart uses a parameter that shows only the Top 6 customers by overall revenue generated, all of which happened to be in NY. When checking for errors before rolling out the dashboard, I noticed that, when NY was filtered out of the dashboard, the Top Customers chart was suddenly empty. The same thing happened when filtering by year, this time the chart was still populated, but only by a few customers. It turns out, the breakdown was happening because of the parameter. Tableau, like any code, has an established “order of operations”, if you will. It turns out, Tableau processes parameters before filters. So unless one of the Top 6 overall customers was from the state or year you filter to, they’re not going to be in that chart.

Think of it like the order of operations for math. Let’s process the equation 4+5x2. First we multiply 5x2 and get 10, because multiplication gets processed before addition. Then when we add 4, it only applies the what we had left after we multiplied, 10. We don’t multiply again just because we added 4 to the results.

When Tableau processes the dashboard onto our screens, the parameters are processed before the filters, just like multiplication is applied before addition. First we apply the parameter to every year and state and get 6 customers. Then when we add a filter, it only applies those 6 customers because that is all we have left after applying the parameter. We don’t apply the parameter again just because we added a filter to the results.

Fixing it was as easy as looking at Tableau’s “order of operations” and seeing if there was any workaround to apply the filters before applying the parameters. Turns out, Context filters get processed before parameters. So I added the filters to the context of the Top Customers chart so the filters would be processed before the parameters.

Blog Logo

Melissa Harper


Published

Image

Melissa Harper

This site is a small portfolio featuring some examples of my data science work.

Back to Overview