How To: Conditional Viz in Tooltip Selector with Tableau

1/11/2018 Matt Chambers 1 Comments




When Tableau releases a new version, it's always fun to play around and see what kind of new hacks are possible.  In a previous post, I showed how to dynamically swap sheets based on dashboard actions, but I figured some of these techniques could be used to conditionally swap vizzes within tooltips as well.  I'm not exactly sure the practical application for this, but I at least wanted to share that it's possible.

First, we need to create a boolean that tells us whether or not our chart has one item selected or not.  This is the condition that I want to use to change the viz in the tooltip.  In this case, I am detecting whether only one category is listed:




Next, I create a case statement to evaluate the filter and dynamically change the sheet tags so I can display the Bar Subcategory when only one category is selected and the scatter plot when all categories are shown:



Drag the calculation to the tooltip:



Finally, to drive the action, I create a dashboard action to self-filter:




That's all there is to it; leave a question with any comments.

UPDATE: Looks like this isn't working on Tableau Public currently.

1 comment:

  1. I was able to get this to work on Tableau Public by having the parameter trigger a Boolean filter that returns no results vs all results for each sheet. It seems to hurt speed on the server though. https://public.tableau.com/views/StrangerThings-PopularityAnalysis/Popularity?:showVizHome=no&:embed=y&:toolbar=n

    ReplyDelete