At Tableau conference 2015, we were previewed a very cool feature called “viz in tooltips”. Tableau conference 2017 is now only 7 months away, and we have yet to see this feature even in beta form. While we wait, there are a few alternatives one can pursue, but come with complexity and overhead. I’d like to present how I’m dealing with the lack of a feature in my professional life…
Here is the viz we are going to build
It isn’t anything special, but it does have some neat tricks that you might find useful. Run through the dashboard action on a click. Run through the dashboard action by selecting multiple bars. Run the dashboard action on a smaller sub-category and notice the axis (fyi… it is not a fixed axis scale).
So let’s recap what this viz does and why it is cool shall we?
- We are packing A LOT of context into a very small space, but we aren’t creating clutter.
- We are creating focus by removing all of the other bars in the view, and allowing more space for the trends.
- When we remove the bars, we keep the overall context by letting the axis extend to the maximum extent of the original view.
- We are gaining functionality that viz in tooltips doesn’t (in theory) have… interactivity.
- We are gaining more functionality that viz in tooltips doesn’t (in theory) have… the ability to “viz in tooltip” multiple marks.
How To: Summary View
Build your summary view… this is how mine looks in Desktop.
Add formatting to the dimension on rows (optional and case by case). I like to provide my users with some familiarity to their everyday life on the internet. By coloring our fields blue, italicizing, and underlining, we have tapped into a part of the user’s brain that knows to click… we really really want that click! As we know, simply formatting a field to look like a hyperlink doesn’t do anything… we will need to add an action later.
Add context in your title. We can’t be certain that a user will know that blue, italicized, and underlined means to click… so tell them what to do in the title and hope they read.
How To: Trend View
Build your trend (or tooltip) view… this is how mine looks in Desktop.
You may be asking yourself something like, “What the shit is this mess? I thought this guy won Iron Viz…” This spaghetti mess is definitely a travesty, but remember, it will be hidden and accessed through a dashboard action… didn’t you run through the actions like I asked you to earlier?
So what is going on here?
Each line is a sub-category because I want to show sub-category sales trends after an action is triggered in the first view we looked at.
We are using Index() for color instead of sub-category because I want my colors to be consistent when the action is triggered. This way, if the action is triggered on Phones, Copiers, or Accessories… the line will always be blue instead of some random color Tableau assigned if we would have used sub-category.
We are using a dual axis to add dots to the min and max sales per sub-category. I’ve built two calculated fields to accomplish this… one for the dual axis and one for shape.
If sales is either the highest or lowest sales for each sub-category then return sales… if not… null that shiz. We put this on rows, turn on dual axis, synchronize, then hide the null indicator for all those nulls we created in the calculation.
This is just a subset of the first calc to create a boolean for shapes. If the calculation returns true, I want a filled circle. If the calculation returns false, I’m using a blank png as my shape.
There is a blank png you can use above this text if you want a copy for your shape folder… I promise it is there… go ahead and right click above the words “There is”.
Spaghetti mess explained. In the end product, we will be seeing a view that looks more like this…
How To: Dashboard
Stop! Do not add either of your sheets to the dashboard yet! First drag a vertical layout container onto the canvas. We don’t want Tableau to start doing that tiled stuff… we want to work with layout containers when we are doing sheet swapping, hiding, and the like.
Now that you have a vertical on your canvas, go ahead and add the summary view, and then add the trend view below it in the same container. Make sure to hide your trend view’s title.
Your dashboard should look something ridiculous like this
Go ahead and get rid of the entire vertical that contains the color and shape legends… we don’t need that clutter. Oh and in case you didn’t listen the first time… hide the title on the spaghetti chart. You should now have something like this…
How To: Dashboard Actions
We need to create two actions to make this thing work: an action that filters the summary view to itself, and an action that filters the trend view from the summary. Now typically speaking, we use a dashboard sheet(s) as our source, and another set of dashboard sheet(s) as our target. To get a view to filter itself we will alter that mechanism slightly by using the summary sheet (at the dashboard level) as our source, and the summary sheet (at the sheet level) as our target… like so:
By targeting the individual sheet, we are making Tableau filter out all of the other sub-categories, whereas targeting that sheet at the dashboard level would just create a focus on the selected sub-category and leave the rest in sight.
The second action we need to create looks like this:
From the summary view, send sub-category to the trend view. When the summary view selection is cleared, exclude everything from the trend view. Bye bye spaghetti.
Note: I ALWAYS use selected fields when I define my dashboard actions. We are better off knowing exactly what Tableau is going to do rather than assuming it will do what we think it will.
How To: Make bars extend to the maximum extent of the view
Note: This will only work on a case by case basis, and with a high level understanding of Tableau’s order of operations.
So you’ve finished this tutorial and your dashboard actions work… you might be looking at something like this:
The problem with this picture is that our self-filtering action ruins the context that the axis normally provides. The Supplies sales value of $46k (ish) is not really where I want the axis to end… I’d rather know what the maximum extent of all the possible bars would be. To resolve for this, we can tap into a nested level of detail calculation and add a reference line to fix the axis to a dynamic ending point.
This says something like: “After context filters, but before dimension filters; calculate the total sales by sub-category and assign the value to the sub-category field, then look at all of those newly created values and find the biggest one.” We can add this field to the detail of our view and then use it to create and invisible reference line like so:
If you’ve made it this far… congratulations, you’ve suffered through my poor writing and built something with some cool functionality. I use this exact configuration with clients all of the time, and may even continue to use it when viz in tooltips finally arrives under our Tableau Christmas tree.