Creating Sankey Charts the Easy Way with Tableau

Historically, creating Sankey charts in Tableau has been a time-consuming process, often requiring the use of complex templates. However, the team at Tableau Public has introduced a game-changing functionality that allows us to create Sankey charts effortlessly. This feature, currently in beta and available for a limited time (like the McRib of data visualizations), enables us to author and publish Sankey charts directly to our Tableau Public profiles.

In this blog post, I’ll briefly walk you through the process of creating one using Tableau Public.

What is a Sankey Chart?

Before we delve into the specifics of this new Tableau Public feature, let’s take a moment to understand what a Sankey chart is and why it’s such a powerful visualization tool. A Sankey chart is a flow diagram that illustrates the movement of data, be it goods, energy, or even money. With a Sankey chart, you can effortlessly compare different data points and identify patterns that might remain hidden in traditional charts or tables.

Testing Out the New Feature

Assuming you already have a Tableau Public profile (and if you don’t, I highly recommend creating one—it’s an incredible platform for sharing your data visualizations with the world). You’ll need to create a visualization directly from your Tableau Public page.

Once you’ve created your visualization, navigate to the “Connect to Data” section. As we’re uploading data from our computer, select the “Upload from Computer” option. Choose the dataset you want to work with—I’ll be using the “Sample Superstore” dataset for this example. After confirming that your data has been successfully imported, select the “Sankey” chart type.

Now, here’s where the magic happens. You’ll notice a “Level” and “Link” section that appears. To define the flow in the Sankey chart, let’s select a dimension like “Segment” and drag it into the “Level” area. Next, grab another dimension—I’ll choose “Region”—and place it in the “Level” area as well. Finally, to quantify the flow, let’s choose a measure like “Sales” and place it in the “Link” area.

Voila! With just a few clicks, we’ve created a Sankey chart. Impressive, isn’t it? You’ll notice the flow between the segments and regions instantly come to life. But we’re not done yet—let’s keep the party going by adding another level.

For the sake of experimentation, let’s grab a dimension like “Ship Status” and drop it into the visualization. Now we have an additional sub-level in our Sankey chart. To avoid overcrowding, we can uncheck the “Allow Labels to Overlap” option, ensuring our chart remains clean and legible.

Keep Innovating for The Analytics Core Audience

Tableau Public’s decision to incorporate this feature highlights their commitment to democratizing data visualization. While the addition of features like Sankey charts to Tableau Public is fantastic, it’s essential that the overlords at Salesforce remember Tableau’s core audience—the general analytics users who are generally decoupled from Salesforce usage. Let’s keep hoping for bigger and better things to come with the tool. This beta signals that they’re heading in the right direction.

I appreciate everyone who has supported this blog and my YouTube channel via merch. Please check out the logo shop here.

Stay in contact with me through my various social media presences.

Thank you!!

Anthony B Smoak

(Note: The mentioned feature and availability were accurate as of the blog post’s publication date, but please refer to the Tableau Public documentation for the latest updates and information.)

Advertisement

Remove the Default Highlighting Effect in Tableau

Have you ever wanted to disable the default Tableau highlighting effect when you select a mark on your chart and then remove the filter? Even when the filter is removed via the “Remove All Filters” process, it can be confusing for the user experience when all values remain “greyed out”, tricking the user into thinking that their filter is still applied. This video will help you remedy this issue and improve your dashboard user experience.

Fortunately, there is a solution to this problem that is simple and easy to implement. In this video I will show you how to use a simple calculated field and highlight action to remedy the issue. This should be default behavior in Tableau, (help us out here Tableau!)

The solution approach involves creating a boolean calculated field and setting it initially to TRUE. Then, placing this calculated field on the detail of the chart that has a filter applied. Next, adding a highlight action to the same chart that you want to remove the “greyed out” effect for. In the “Add Highlight Action” pop-up box, the Source Sheet and the Target Sheet should be the same and the Selected Fields option should have the boolean calculated field checked.

By following these steps, you will be able to remove the greyed out effect on your Tableau chart when the “Remove All Filters” process is applied.

This not only improves the appearance of your dashboard but also makes it easier to understand the data.

★☆★ THESE ADDITIONAL FILTERING VIDEOS IN TABLEAU ARE WORTH YOUR TIME ★☆★

Don’t let the greyed out effect on your Tableau charts hold you back any longer. Watch the video and follow the steps outlined in this blog post to improve the appearance and functionality of your Tableau dashboards.

You can also follow my dapper data adventures on Instagram.

Stay in contact with me through my various social media presences.

All views and opinions are solely my own and do not necessarily reflect those of my employer

I appreciate everyone who has supported this blog and my YouTube channel via merch. Please check out the logo shop here.

Thank you!!

Anthony B Smoak

Tableau Tile Map Data Project

I was recently inspired by some really great tile-maps that have been created in the Tableau community (e.g., see beautiful work by Chimdi Nwosu and Michael Dunphy). Thus, you know I had to come up with a way to construct a simplified map in this style with some data and share with my followers. In these two videos, I’m going to walk you through how to prepare the necessary data file in Tableau Prep Builder and then we’ll build out the tile-map in the second video, step by step.

This is a good intermediate level portfolio project for you to follow along with in order to increase your Tableau Desktop and Tableau Prep skills. We’ll use CDC data, specifically United States COVID-19 Cases and Deaths by State over Time, to build the tile-map.

The advantage of a tile-map is that it represents geographic regions (like states) at equal sizes. Thus, the distortions and biases introduced by differences in sizes are eliminated. In the case of the United States, data for smaller regions like Washington D.C. can be interpreted on equal footing with data for a much larger region like California.

Tableau Prep Builder helps to greatly simply the data shaping process. My only wish is that Tableau would integrate Prep into Tableau Desktop for one seamless data tool to rule them all, but I digress. The process below illustrates how simple it is take some data from an input file, and subsequently clean and pivot the data into a new file. Watch the first video, to learn how to build out this simple flow in Tableau Prep. If you do not have a copy of Tableau Prep, you can complete this lesson on a 14 day trial license of the tool, which you can download here.

Watch the second video for the step by step instructions to build out the tile-map above.

Please like and subscribe on the Anthony B. Smoak YouTube channel.

All views and opinions are solely my own and do not necessarily reflect those of my employer

I appreciate everyone who has supported this blog and my YouTube channel via merch. Please click here

Thank you!!

Anthony B Smoak

Place Bar Chart Labels Above Bars in Tableau

In this video I will provide a method in which you can place your bar chart labels above the bars in Tableau. This technique is based off Adolfo Hernandez’s technique with a little more explanation and additional alternatives for the zero line. Make sure to add this to your bar chart repertoire!

If you want to follow-along with the video, you can download the data at this link:

https://www.basketball-reference.com/leagues/NBA_2021.html

In the video I exported data from the “Per Game Stats” section but you are free to download from whichever stats section you’d prefer.

High Level Steps:

Make sure to watch the video to get more in-depth:

  1. Drag your measure to columns (e.g., 3P)
  2. Drag your dimension to Rows (e.g., Team)
  3. Sort the measure to descending value
  4. Place the Team and 3P on the label and format accordingly
  5. Create a placeholder directly on the Columns shelf : AVG(0))
  6. Drag the placeholder to the bottom of the visual onto the 3P axis to make a combined axis visual
  7. In the Measure Value area make sure that AGG(AVG(0)) is placed above SUM(3P)
  8. Uncheck “Show Headers” for the Team dimension and for the axis at the bottom of the visual
  9. Format the visual to remove unnecessary borders and lines
  10. Make the following adjustments on the Label:
    1. Marks to Label: Min/Max
    2. Scope: Pane
    3. Field: Measure Values
    4. Options:
      1. Allow Labels to Overlap Other Mark
      2. Label Minimum Value
  11. Change the color of the bar chart borders to the background color of your visual in order to camouflage the tiny bar created by AVG(0)
  12. Uncheck “Show Header” for AVG(0)

When it’s all said and done you have a fresh new take on adding labels to your bar chart that can add differentiation to your overall visual!

For more detail on how to add a zero line (which I believe is important for bar charts in general and is a good design practice), watch the video.

Please like and subscribe on the Anthony B. Smoak YouTube channel.

All views and opinions are solely my own and do not necessarily reflect those of my employer

Do Great Things with Your Data!

Amazing Tableau Dashboard for Inspiration

I worked hard to create a Tableau dashboard packed with multiple features that any beginner or intermediate user should know how to complete. Use this dashboard as an inspiration regarding techniques to learn for your next Tableau dashboard.

Here are a few of the features included in this dashboard:

  • Parameters
  • Dynamic Titles
  • KPIs
  • Filters
  • Context Filters
  • Top 5 by Dimension
  • Highlight Actions
  • Filter Actions
  • Ranking
  • Show/Hide Containers
  • Image Buttons
  • Parameter Driven Chart Swap
  • Maps
  • Shape Files
  • Reset All Filters
  • Combo Chart / Dual Axis Chart (Bar in Bar)
  • Quick Table Calculations
  • Bullet Chart
  • Animations
  • Containerized Dashboard Layout

Because I love to teach in my relatively spare time, I am considering offering 1 on 1 training to learn how to put together this sample dashboard. As I mention in the video, leave a comment with your thoughts on how much of an investment you think someone would make for 3 hours of 1 on 1 training to build this together. Someone would definitely impress their manager or future hiring manager if they had the knowledge to build this type of front end reporting.

Let’s learn together, contact me here for more information: https://anthonysmoak.com/contact/

Interact with dashboard here ► https://tabsoft.co/3nU4c4Y


Please like and subscribe on the Anthony B. Smoak YouTube channel.

Definitely pick up some merch if you’ve enjoyed this blog and YouTube channel over the years:

https://shop.spreadshirt.com/AnthonySmoak/

All views and opinions are solely my own and do not necessarily reflect those of my employer

Do Great Things with Your Data!

Anthony B. Smoak, CBIP

Tableau Dashboard Project #VIZNESSFIRST

In this video I kickstart the #VizznessFirst​ initiative where I describe a Tableau Dashboard I constructed using multiple resources from the Tableau #datafam​ community. Invest your valuable time in watching the videos as it will be worth the investment if you’re looking to pick up some new skills.

I describe the dashboard, show you the resources and then you attempt to build it. This is a perfect intermediate/advanced dashboard idea starter for students looking to improve their Tableau skills.

Background

Let’s start with a little background on how this initiative came together. I am a big fan of the Real World Fake Data (i.e., RWFD) project run by Mark Bradbourne at Tableau. I wanted to finally get involved and put together a dashboard and hopefully learn something new.

Because the particular data set used (Week 5: Help Desk) had very few measures to sum or aggregate; this left counting rows as the most informative means to squeeze some meaning from the data.

I stumbled upon an excellent blog post from Tableau Zen Master Lindsay Betzendahl where she explained a technique to highlight when a “filter” has been activated with a small indicator. I reversed engineered her dashboard to try and tease out how to pull this off with the RWFD data set.

In addition to this technique, I mashed up some other techniques from various members of the Tableau community. One of the great things that I enjoy about the Tableau community is that there are many creators who put out great content for others to learn from; whether it be videos, blog posts, PowerPoint slides, etc.

Once I had a dashboard I was proud of sharing. I figured I would release it as a series to try and teach others some of these techniques. The 3 videos in this series is the culmination of that effort.

VIDEO 1: Overview of the Project and Resources Required

Here are the references I used to put together the dashboard.

VIDEO 2: STEP BY STEP INSTRUCTIONS

Make sure to watch Video 2 above because this is where I explain the main technique required to complete the dashboard.

VIDEO 3: STEP BY STEP INSTRUCTIONS (TABLE TRICKS)

Video three rounds out the series by demonstrating a cool trick that enables you to build a filter button that opens a detailed table dashboard populated with only the records of interest from the first page. Yes, it uses a filter action but there is twist. Make sure to check it out.

SHARE WHAT YOU CREATE

  • POST YOUR FINISHED DASHBOARD TO TABLEAU PUBLIC:
    • DASHBOARD BUILT USING TABLEAU DESKTOP 2020.4.1
  • SHARE YOUR LINK IN THE COMMENTS ON THE YOUTUBE CHANNEL:
    • 10K+ SUBSCRIBERS CAN VIEW YOUR ACCOMPLISHMENT
  • YOU CAN ALSO POST TO:
    • TWITTER
    • LINKEDIN
  • MAKE SURE TO INCLUDE:


If you enjoyed this tip, please like and subscribe on the Anthony B. Smoak YouTube channel.

Definitely pick up some merch if you’ve enjoyed this blog and YouTube channel over the years:

https://shop.spreadshirt.com/AnthonySmoak/

All views and opinions are solely my own and do not necessarily reflect those of my employer

Do Great Things with Your Data!

Anthony B. Smoak, CBIP

Show and Hide Containers in Tableau

In this video I’ll show you how to show and hide containers in Tableau at the push of a button. This makes for a convenient way to increase space for your dashboard while hiding your filters or switching to an additional hidden chart until needed.

If you’re not using at least Tableau 2019.2.0, then you need to run over to your I.T. department and have them set you up. In previous versions of Tableau you could achieve this effect, but you would have to implement a hacky methodology in order to pull it off. Although I love a good hack, we should all strive to work smarter not harder.

The key to pulling off the show/hide container is to add a floating horizontal or floating vertical container to your dashboard. Only once you’ve taken this step can you see the option to “Add Show/Hide Button”.

Once you’ve selected this option, any new sheets, filters or other objects you wish to place in your container are enabled to appear or disappear at the press of a button.

An “X” marks the spot as this default customizable icon will appear. You can replace this image with text or use your own customizable image in its place.

As a reminder, (from the Tableau Knowledge Base) these options “will not be available if the sheet is not on a horizontal or vertical container and that container is not floating.”

In lieu of the default show/hide icons, in the video we will use buttons from a template provided by Kevin Flerlage. Do yourself a favor and head on over to the Flerlage Twins blog and download this handy resource.

Make sure to give your filters and charts the “Personal Space” they need! Rick and Morty aficionados know exactly what I’m talking about.

For the Power BI curious, here is how a similar process is conducted, where the filters (ahem) slicers are hidden at the touch of a button.


If you enjoyed this tip, please like and subscribe on the Anthony B. Smoak YouTube channel.

All views and opinions are solely my own and do not necessarily reflect those of my employer

Do Great Things with Your Data!

Anthony B. Smoak, CBIP

In all seriousness, the world lost an icon of baseball and civil rights as of the recording of this video; Mr. Hank Aaron. I live in Atlanta so I have to pay my respects with a shout out to Hammering Hank. Rest in Peace #44.

Add Total Values for Stacked Column and Stacked Bar Charts in Excel

This is the only video you need to learn how to add add totals to stacked bar charts and stacked column charts in Excel. Make sure to watch the video because I have you covered both ways.

I’m more of a video explanation person, so make sure to watch the video so the steps are clearer. Then refer to the bulleted steps as reference once you have the initial basic understanding.

The Keys to Adding Totals to the Stacked Column Chart Above:

  • Add a “Grand Total” column to your data
  • Highlight your data not including the “Grand Total” column
  • On the “Insert” menu select a “2-D Stacked Column” chart
  • Select “Switch Row/Column” as necessary so your first data column is listed on the X axis
  • Select the chart and then expand the data range to include the “Grand Total” column
    • Add “Data Labels” to the Grand Total series on the chart
  • Right click on the Grand Total and “Change Series Chart Type”, the viz becomes a “Combo” chart
  • Change the “Grand Total” series chart type to a “Line”, while leaving all others as a “Stacked Column”
  • Format the line’s data label, changing the Label Position to “Above”
  • Select the line, format the data series and change the “Line” option to “No Line” in order to leave only the totals and hide the line.

The Keys to Adding Totals to the Stacked Bar Chart Above:

  • Add both “Grand Total” and “Spacing” columns to your data
    • Highlight your data including the “Spacing” column but not including the “Grand Total” column
      • The “Spacing” column should have a value of 0 at this point
    • On the “Insert” menu select a “2-D Stacked Bar Chart”
    • Select “Switch Row/Column” as necessary so the “Spacing” values are not listed as an option on the Y axis
    • Change the “Spacing” column values to a number (e.g., 1000) big enough to make a new category visible on the stacked bar chart
    • Right click to “Format Data Labels” and change the “Label Options” to “Value from Cells”
      • In the “Select Data Label Range” pop up box, highlight the values from the “Grand Total” column
      • Change the “Label Position” to “Inside Base”
    • On the chart select the Grand Total Series and right click so the “Fill” option appears
      • Change the “Fill” to “No Fill”
    • Change the values in the “Spacing” column to 0
    • Delete the “Grand Total” entry from the Legend

You can thank me by liking and subscribing to my YouTube Channel

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Do Great Things with Your Data

– Anthony B. Smoak

shop.spreadshirt.com/AnthonySmoak

Drill from Region to State Using Parameter Actions in Tableau

When the data goes high, you can go low; to misquote a common saying. In this video I’ll show you how to start at a region level on your Tableau map and then drill into the State.

If you’re using the Tableau Superstore data set, make sure the Region and State fields are assigned to a geographic role. Most likely you will need to change the Region to a geographic role, which is created from the State field.

At a high level we’ll have a dual axis based upon the latitude, with the top latitude displaying the regions and the bottom latitude displaying the state. When we layer them on top of each other, we begin to create the illusion of the drill.

We’ll use a parameter creatively named [Region Parameter] which contains all of the regions. From there we’ll create a calculated field named [_States to show] as follows:

If [Region]=[Region Parameter]
Then [State]
END

In order to institute the drill, we’ll create a worksheet parameter action that will change the value of the region parameter on user selection. This causes the clause (If [Region]=[Region Parameter]) to evaluate to TRUE which then causes the display to show the states for the selected region.

It sounds more complicated than it is, so just make sure to watch the video for understanding and clarity.

As a bonus, I’ll show you how to achieve this effect where the selected region does not cause the other regions to gray out. Notice on the second map how all the non selected regions do not lose emphasis; this is not the default effect. It’s the little “show-off” details like this that can up your Tableau game. You’re welcome!

You can thank me by watching, liking and subscribing:

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Do Great Things with Your Data

Anthony B. Smoak

How to Filter your Tableau Viz in Tooltip (Top 10 Values)

Visualizations in tooltips, affectionately know as “Viz in tooltip” is a handy feature available in Tableau that enables “details on demand” functionality. As the user hovers over a specific mark or data point, additional details are revealed that are filtered specifically for that mark from another worksheet.

In the example above, as the user hovers over a bar, they obtain additional details about the three most profitable products associated with the respective bar.

As I learned in a very informative Tableau presentation for tooltip wonks (myself included), the underlying architecture is built upon action commands and shares many commonalities with action filters. For viz in tooltip performance considerations, use smaller and fewer visualizations. Also try to avoid maps and other complex visualizations that have significant mark density.

If your tooltip responsiveness is greater than 2 seconds or the height and or width is greater than 600 pixels, then consider rethinking your approach. According to Tableau best practice, users are not willing to wait more than 2 seconds hovering over a mark for a reveal.

Since the viz in tool tip passes filters between worksheets, this means we can make use of context filters (click this link for a fantastic overview) to limit the number of marks returned and help improve performance.

This is the Section You are Here for

Context filters also help solve the problem of returning the Top N records associated with a mark. When you assign a viz in tooltip on your source sheet, a set filter is applied on the target (i.e., viz in tooltip) worksheet. If you’re a frequent watcher of my videos you know that the Tableau order of operations prevents the default set filter from returning a proper Top N.

By adding the set filter to the context on the Order of Operations skyscraper, the data is pre-filtered by your dimension first (e.g., State) and then the Top N filter is applied. When the set filter turns gray, you know it’s working.

Notice that the Context Filter box is above the Sets entry; which means that the Context filter is evaluated BEFORE the set. Make sure to watch the video to learn how to limit to the Top 10 cities based upon a hovered state.

Check out the video for details and may all your viz in tooltips be context appropriate!

All views and opinions are solely my own and do NOT necessarily reflect those of my employer.

Do Great Things With Your Data

-Anthony B. Smoak