Condition-based hiding of Worksheets

by Frederik Egervari

If you are building a dashboard, you often run into the situation that you might only want to show a certain worksheet if a condition is met. Tableau offers the possibility to make a worksheet seemingly disappear when it is blank

Let’s go through it following an example:
Imagine you are working with the superstore and you want the user to be able to switch between the sales by category or by segments.

Therefore we set up a parameter that allows choosing between three options. Then we create a calculated field because we can’t filter by the parameter itself. The calculated field is used as a filter on both worksheets.

A dimension in the rows or columns is needed on both worksheets. So if you don’t need one for the actual chart, you might want to create a dummy variable that just contains an empty string. Put this dummy into the rows and hide the header. A view won’t notice it is there, but Tableau requires it for us to make the worksheet exchange to function.

Now we can create the dashboard. For our exchange of sheets to work, when we change the parameter, what we need is them to be inside a container. Then you can hide the title – if they are not hidden, it won’t work since the sheet would not be empty.

So to sum it all up, you need to:

1.       Put your worksheets in a container

2.       Hide the titles

3.       Put a dimension onto rows/columns

And once you have completed those steps, your result should have the replacing-functionality.

Sun 10 Sep 2023

Sat 24 Dec 2022

4 mins read

Wed 31 Aug 2022