Introduction
The goal of this article is to demonstrate how to hide and show columns containing null values in Tableau tables. To demonstrate this, I have created the dummy dataset below.
(Notice, this table contains details up to Sub-Category level for West Region, while East region’s data is captured up to Product level, with Central region combining products with quantities ordered. Meaning, if you’re to present this information in table format for each region – you’ll end up with tables containing null value columns as shown below).
(Which is not the best way to present the data – the perfect way would be to hide the null value columns and show them whenever they are required)
The Problem – how to hide/show null value columns in Tableau
There is no straight forward technique that you can use to hide and show null value columns in your Tableau tables. However, there are some tricks that you can use to deliver a product that offers the same user experience by leveraging sheet swapping.
To do that, first create separate worksheets presenting data for each Region as shown below.
Use Parameter to hide/show worksheets based on the selected values.
Create a parameter.
Create a Boolean calculation to hide/show worksheets based on the selected value on the parameter.
Add this calculation to each worksheet as a filter and select ‘TRUE’
(Notice, the worksheets remain visible whenever the parameter value is the same as the Region on the filter, and remains invisible if otherwise).
Combine the three worksheets on the dashboard
Open a new dashboard, and add a vertical or horizontal layout container.
Next drag the three worksheets into the layout container.
Hide the titles.
Show the parameter ‘Select Region’
(Using the parameter – you can seamlessly swap worksheets, giving the impression of hiding and showing null value columns - when in the real-sense you’re simply swapping the different worksheets.)
Conclusion
If this post was helpful and you would like to receive more of these Tableau tips and tricks, kindly subscribe to our mailing list below.
If you like the work we do and would like to work with us, drop us an email on our Contacts page and we’ll reach out!
Thank you for reading!