A request I often get, and it surprises me that it’s not easier, is being able to click on a Tableau map and have it automatically drill to the next level of the hierarchy. Example you have a map of states, you click ‘Maine’ and it drills down to the cities in Maine. Then you click ‘Bangor’ and it drills to the Postal Codes in Bangor. Despite the hierarchy existing in Tableau this click nav isn’t possible on a map.
I client finally requested it and I buckled down and made it for them.
Step 1 Create Parameters: I think the only/best way to do this is with a series of parameter actions. Using the superstore data I’ve create a para region that it populated with all of the Regions and then a manually created field of “All”. I’ve done the same for State (para State).
Step 2 Create Sheets: This is also easy. Create 3 maps. First is filled by region, second is filled by State and third is City which is a circle shape.
Step 3 Logic to Swap Sheets: We need to use our parameters to determine when we show or hide a sheet. Create two calculated fields:[Para Region] = “All” [Para State] = “All” We apply both Filters to all three sheets. Region Boolean is True on the Region sheet and False on the State and City Sheets. The State Boolean is True on the State sheet and False on the City Sheet. This should lead to only one sheet being hidden at a time (in hindsight you could probably pair this down to a single calculated field).
Step 4 Dashboard: Add a Vertical Layout Container to your dashboard. Drag all three sheets into the layout container. Hide the titles on all three sheets. The “Active” Sheet should fill the container totally. If not, make sure each sheet is set to fit entire view.
Step 5 Parameter Action: This is the coup de Grace. Go into Dashboard -> Actions -> Parameter Actions. We need to set the Region Map to change Para Region. For your parameter set it to “Para Region” field is “Region” no aggregation. Do the same with State.So now as you click “Region” the Parameter changes, Region sheet hides (since the parameter is no longer “All”) and State sheet shows up filtered on the Region. If you set up the State Parameter to do the same, except obviously being populated by the state field, then you’ll be able to drill down to the next level. Step 6 Anything done must be undone: This is great but unfortunately it doesn’t let us climb back up the ladder. I’ve added State and Region buttons to allow users to go back up the views. These are individual sheets and they each have a calculated field on them called “All” which is simply “All”. When you click these sheets there is an additional parameter action that sends the “All” value to the State and Parameter Values respectively. Which has the reverse effect of passing in the state or region names. Feel free to explore or download the full workbook here