top of page

Can You Still Expand/Collapse Views in a Container with Dynamic Zone Visibility?

Updated: Apr 13

I have been exploring this Dynamic Zone Visibility feature that Tableau released a while back. In a previous blog post here, I show you how to change views with a Sheet Swapping method. This allows you to swap sheets on a dashboard.


So what is Dynamic Zone Visibility? It is very similar to sheet swapping. You are hiding and then revealing zones based on Parameters automatically. They suggest that you use this functionality to hide or show different zones for different groups. They have a how to example here that I thought was somewhat hard to follow.


I will show you how to create a visual using this method. A video clip is below;



Prefer to watch a video on this instead of read the steps? Check out my YouTube video here.


Here are the steps for the content;

I am connecting to the famous Sample Superstore data set for this example.

First on a new worksheet, add Region to the Columns shelf and then add Sales to the Rows shelf.

Label this sheet Sales by Region.

Create a calculated field called True with the text True in it.

Place this on the Detail Marks card of this sheet.

Then create a calculated field called Dummy with the text "Dummy" in it. Also place this on the Detail Marks card. We will use this to disable highlighting later.


Your worksheet should appear as below;


Create a Parameter that has a Boolean data type. This will just provide you with True or False values.



Then on a second sheet create a map. You can do this by double-clicking on State. Tableau will automatically add Latitude and Longitude to the view. You may have to adjust this in the Map menu if you are not in the United States.

Change the Chart type to Map so it will be a filled map and not a symbol map. Then add Sales to the Color Marks card.

Place Region field and the True calculated field on the Detail Marks card.

Your sheet should appear as below;



Now create a dashboard.

Add a Horizontal Container to the dashboard.

Add the Sales by region worksheet onto the dashboard in the horizontal container. (You can just double-click on the sheet in the Dashboard pane.)

Go to the Dashboard > Actions menu to Add a Parameter Action from the Add Action drop-down menu.

Set up your Parameter Action as shown below;



Now add your Map worksheet to your dashboard inside the Horizontal Container.

Remove the Legend and manually adjust the map so its equal distance next to the bar chart.



Next click the use as a filter button on the Sales by Region worksheet.



This will allow you to zoom in the map by clicking on the Region bars in the bar chart.

Click on the Map worksheet in your dashboard.

In the Layout tab, click on the Control visibility using value box.

Select the ZoneSwap parameter from the drop-down that appears when you check this box.



This button will hide the map when you do not have a bar selected in the bar chart.

The last step is to add a Highlight Action.

Go to the Dashboard menu and select Actions.

Then select Highlight from the pop-up menu.

Set up the Highlight Action as shown below;



This will remove that pesky highlighting when you click on a bar in the bar chart.


It may be a better use case to have the map inside a tool tip, but I wanted to show you a different example than what the Tableau site had.


If you wish to interact / download this workbook, it is in my Tableau Public profile here.



コメント


bottom of page