How To: Conditional Viz in Tooltip Selector with Tableau

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.

2017: A Year of Firsts

I couldn't think of a better image to sum up 2017 than this.  As a kid, I grew up attending football games at Clemson and always dreamed of seeing my name on the Jumbotron.  This was one of the coolest perks for presenting at the 2017 ACC Fiscal Officer's Conference.  This is something I never expected to see, but that seemed to be the theme of 2017.

2017 started out with my Clemson Tigers in the College Football Playoff and ultimately in the National Championship.  I was lucky enough to attend the game, and I was able to see my team win in person.  This is another event I thought I'd never see in my lifetime.  Clemson last won the National Championship before I was born in 1981.  I've always said that if somehow Clemson were to make it to a National Championship I would find a way to attend.  I was able to attend both National Championships and ultimately see the win in 2017.  This inspired me to create a visualization to commemorate the game.

This visualization was truly a labor of love as I had to manually convert all of the play by play text into rows that could be visualized.  After I was done, I really liked how the visualization showed the entire flow of the game, but then I thought what if I could link it to the actual game footage.  So I began another labor intensive process of actually watching every play and linking the Youtube timestamps to the play by play data.  Sometimes you have to ask yourself "is the juice worth the squeeze", and this time it was:

I posted this viz to a Clemson Football board called Tigernet and fans loved it.  Clemson fans all over would mention this viz, and I heard in passing several times, "Hey, did you see that cool visual of the game on Tigernet?"  It was really cool to see how much fans loved it, and it even made the Tigernet Hall of Fame.

Another first for me in 2017 was starting the Greenville South Carolina Tableau User Group.  Greenville SC is a relatively small market with a population of about 100k.  I started the user group in January of 2017, and we had about 35 people show up to the first meeting.  By our last meeting, we had 50 people attend, which I'm really proud of being in such a small market like Greenville SC.  We have had several different presenters showing new techniques and ways they are using Tableau.  I'm excited to see how it continues to grow in 2018.

I also happened to be directly in the path of the Great American Eclipse of 2017.  I wanted to commemorate this event by building a visualization that could track the Eclipse's umbral path in real-time.  I was able to build this using shapefiles and the Javascript API so that the path of the eclipse would actually move as the actual eclipse moved across the country.  I also live-tweeted images of the eclipse's path moving across the country which was really fun.

I've created a few other vizzes that went viral but none had the impact of my Mayweather vs McGregor visualization.  I created this visualization as a way to take minimal data but still show it in an engaging an informative manner.  The source data for this visualization comes from this crosstab:

So from those few data points I tried to build something that had a clean design but also conveyed all of the information within a few seconds.  This visualization seemed to really resonate with people.  It was also selected as a Notable Viz of 2017 by Tableau.

This viz also lead to another first for me; 2 million views on my Tableau Public work.  This is extremely humbling to me.  I grew up in a town of about 500 people, so to have the opportunity to reach so many is amazing.  Thank you Tableau, Tableau Public, and the Tableau Community for helping me to reach so many!

I'm looking forward to continuing to learn from and contribute to such an amazing community in 2018.  The Tableau community is the best community in all of software, and I can't wait to see how it continues to grow and evolve.

Have a Happy New Year!

Is Star Wars: The Last Jedi the most divisive in the saga?

I haven't seen Star Wars: The Last Jedi yet, I plan to over the holidays, but I've read a few reviews and noticed how different the reviews seem.  Some reviews say the movie is great while others don't offer as much praise.  I took a look at the critic and audience ratings on Rotten Tomatoes, and there is definitely a large variance between the ratings of critics and the audience for the latest film.

I wanted to visualize all of the films in a small multiple view so that we can see how the ratings of the other films compare.  4 of the films fall within +-5% variance while there are a few like Revenge of the Sith and Return of the Jedi where the audience and critics scores vary up to 15%.  However, we see the largest variance in The Last Jedi; a variance of 37%.

How To: Tableau Sheet Selector with Dashboard Actions

One of the very first tricks I learned in Tableau was how to create a sheet selector.  I used this trick in one of my first Tableau Public visualizations on Tommy John surgery.  This was the first time that I realized you could add additional functionality to Tableau even if said functionality is not supported out of the box.  Adding a sheet selector let's the user change the sheet within a dashboard without moving to another dashboard.  This technique relies on using a parameter to change a filter that hides or shows dashboards within a container.

This is a tried and true technique, but I wanted to be able to do it without using a parameter.  I wanted to be able to use different user interface elements to drive the sheet selector, so I will show you two different options.

Option 1: Driving the sheet selector with a shape

This method allows the user to design a user interface where iconography can be used to change the sheet that is shown.  Here's how it's done:

1. First, you will need to create a spreadsheet with a list of views that you will be selecting.  In this case, I am going to allow the user to switch between a bar chart, a map, and a table.

2. Join this file to your existing file using a right outer join with a join calculation of 1=1.  This allows all visualization types to tie to each record of your data set.  This will allow us to filter later.

3. Create the visuals that you would like to select.  You are now ready to create the filters that will allow the sheets to show or hide.  First, create a calculation that will serve as a boolean filter for showing the charts.  You will need to create this for each chart type.

4. Drag each filter to each chart and choose True.

5. Create your shapes that will filter the view.

6. Now we can start to put the dashboard together.  Drag your shape worksheet into the dashboard and add a container.

7. Drag the three charts into the container.

8. Create a dashboard action filter.  The chart with the shapes should be set to filter the other three charts.  In this case, we want to set clearing the selection to "leave the filter" so that only one chart shows.

You should now have a dashboard that changes sheets and is driven by a user interface element such as a shape instead of using a parameter!

After I finished up this technique, I mentioned it to Ken Flerlage to see if he would find it useful, and lo and behold he had previously implemented almost the same technique in his amazing Beauty of Pi viz.

Option 2: Driving the sheet selector with a chart

This method allows the user to click on a chart and change the other sheets in the dashboard.  This method does not require joining in the additional file.

1. Create the visuals that you would like to select. In this case, I am going to swap a sales/profit scatterplot for a subcategory bar chart.

2. Once again, drag on a container and drag the charts inside.

 3. Create a dashboard filter action to filter the charts inside the container when clicking the top Category bar chart.

4. Create a boolean calculation to show/hide the charts.  In this case, the level of detail calculation is detecting whether only one category is selected.  This allows the chart to be shown or hid based on one or more categories.

5. Click on the category chart and navigate to the subcategory chart while the selection is still made.  Drag Show/Hide Chart to the filter and select "True."

6.  Now navigate back to the dashboard and click off of the chart.  Navigate to the scatter plot and drag Show/Hide Chart to the filter.  Choose "False" as we do not want this view to appear when we have clicked on the Category.

Now you have a dashboard that is able to switch sheets based on clicking a chart!

Feel free to download the workbook and comment with any questions.