For this month’s #ThrowbackDataThursday, I wanted to make sure that I took some of what I saw, learned and/or was inspired by during Tableau Conference, and incorporate that into my viz.
During Iron Viz this year, all three competitors created some pretty awesome visualizations that each had their own merits. I especially liked how Lindsey Poulter stayed true to her form and built a “business” dashboard. I really enjoy creating and sharing visualizations to Tableau Public because it allows me to step outside my typical daily work and create vizzes that have a wow factor. But what if I could take a typical “business” viz and make it super interactive and have that same wow factor? I took Lindsey’s approach as my inspiration and decided to create something that I thought could be used in the real world.
Second, during the Keynote and Devs on Stage, I really thought the Metrics that are coming to Tableau Server were super cool! I like that a user will be able to create targeted KPI’s that they can track and monitor from their favorites in Server without having to open multiple workbooks. I also liked the functionality that the metrics employ when looking at time series data that allows the user to click the metric and see the change versus the prior data point. Fortunately, with the magic of Parameter Actions and some creative calculations, it’s 100% possible as of Tableau 2019.2.
And finally, I spoke with many people during the conference, and came to appreciate how agile my team is with our Tableau Server environment. We’re upgrading to Tableau Server 2019.3 tomorrow, and many of the people I spoke with at Tableau Conference are still on 2018.3 or 2019.1 at best. So, I wanted to make sure I leveraged some of the newer features, including the parameter actions I mentioned above, as well as the show/hide button on floating containers.
How I Built It – Line & Gradient Area Chart
Now, with the viz inspiration out of the way, let’s dig into the viz and talk about how it works. The major pieces of the viz are a set of BANs and a Revenue Line Chart. The BANs have the same metric switching as the new Tableau Server Metrics feature and we’ll dive into that in a minute, but first let’s unpack the line chart.
So, it’s a bit more than just a line chart. Inspired by the gradient area charts on Google Finance, I wanted to color the line based on the move versus the prior quarter (or overall if no quarter is selected), and have an area chart that fades to white beneath the line. Ken Flerlage has a great post about how to create a gradient area chart, but wanting to keep the viz “business ready,” I didn’t want to rely on data densification or fixed axes as these are practices I’m unlikely to use at work.
Instead, I leveraged transparent backgrounds and layered the line chart on top of an image that has a transparent to white gradient on top of my area chart. This relies upon a floating layout, so that means I might not really use this approach at work, but it’s much more reasonable than creating multiple copies of my data through an intended cartesian join. Plus, the visual is worth it!
There’s a bit more magic in the line charts. Clicking anywhere on the line sets the [Fiscal Year & Quarter Parameter] Parameter through a parameter action. This drives several calculations, throughout the workbook. On the line chart, it adds a dot to show the selected quarter through the calculation below. I placed this on the Rows shelf next to [Revenue] and made it a dual axis with synchronized axes and voila.
It also causes the BANs to update to either show that quarters’ revenue or the change from the selected quarter’s revenue to the prior quarter. Finally, it updates the selected quarter for the bar chart that shows the revenue split by business unit.
How I Built It – Metric Swapping BANs
Now that we’ve discussed the line chart, let’s unpack the BANs. I really like BANs as they are super useful in calling out key information. I really love these BANs as they employ interactivity to add layers of analysis for the user.
Let’s look at how I built this. If we start with [Revenue] and place it on Text on the Marks Card, we’re headed in the correct direction, but if we want to be able to switch between different metrics – Revenue, Change in Revenue and Percent Change in Revenue – we need to first create a series of calculated fields.
I first created individual calcs for each (revenue, change and percent change), to bring back the correct value depending on whether or not a quarter had been selected in the first parameter action I described above. Then, I created a simple string parameter called [Metric – Revenue]…
…then used a case function to choose which of my metrics should show up depending on which parameter value is chosen.
To handle the formatting of the numbers (two are dollars and one is a percent), I created prefix & suffix calculations, as well as a “Description” calc that explains what is showing and put them on text along with my “Switcher” calc as follows:
So far so good, but to make the metrics change, we need to create something to feed into our parameter action. A quick description of how parameter actions work, in case you’re unfamiliar: Parameter actions allow for a Field to provide a value that sets a Target Parameter. In this instance, our target parameter is the one we created above – [Metric – Revenue], but we need to define a field that can set the value of the parameter.
Here, we’re going to us a bit of what I’d call circular logic. I know that I want my values to cycle through Revenue -> Change in Revenue -> Percent Change in Revenue and back again. I also know that when the [Metric – Revenue] is set to ‘Revenue – Value’ that Revenue is displayed. To force my parameter action to cycle to the next step, I need a calculation to feed in ‘Revenue – Change.’ To do this, we’re going to create another calculated field that I call my [Metric – Revenue Switcher]:
We then place this field on details, and head to our dashboard. Once the BANs worksheet is on the dashboard, we’ll create a dashboard action to run when the user clicks (Selects) the BANs. Our target parameter is [Metric – Revenue], and our Field is [Metric – Revenue Switcher].
Once the action is setup, you can test it by clicking through the different metrics!
How I Built It – Details and Sparkline Switching
The dashboard is broken into two sections – the big top section focuses on the overall Walt Disney Company revenue, but the bottom section is broken into the business units or revenue streams. I added an extra feature in the revenue stream analysis section that allows the user to view some specific quarter over quarter detail. Once again, we’re using a parameter action, but this time, we’re also using parameters to swap sheets. Not going to go into a lot of detail here on sheet swapping as it’s a very old trick, but the user drives the sheet swapping by clicking on a text sheet that directs the user to click. This pulls up the detail, and swaps the text with a sparkline. A tooltip on the sparkline tells the user that clicking again will bring back the larger revenue trend.
How I Built It – Finishing Touches
I am a stickler for “finished vizzes.” To me this means that the viz or dashboard has well written and formatted tooltips, colors and fonts are standard across the workbook and information is provided when necessary. The first piece – tooltips – is one of my biggest pet peeves. I really dislike the standard Tableau tooltips because in most situations, they’re not appropriate or well organized (sometimes in very simple settings they’re passable). Also, tooltips for an entire workbook can typically be cleaned up and formatted in less than 10 minutes – it’s really the little things that count. In this viz, my tooltips needed to be informational as well as provide instructions on what would happen if the user clicks.
For dashboard information, I wanted to give the user a brief overview of the dashboard, as well as some details on how to use the dashboard. For this, I leveraged a floating container and used the show/hide button to either display or collapse the information.
With regards to color, I chose the default palette to be colorblind friendly, but also wanted to provide the opportunity for the user to view it in the (overused) red/green palette. I added a section to my dashboard information that (once again) leverages a parameter action to allow the user to toggle the palette.
The last finishing touch was cleaning up the dashboard for mobile viewing. In most cases, mobile dashboards are more of a high level view, and due to this, some functionality (including the show/hide button mentioned above) is not available or feasible. With this in mind, I removed some of the worksheets that wouldn’t work well on mobile and included a note that the dashboard is best viewed on a computer.
I’m pretty pleased with the culmination of all of these pieces into the final dashboard. I’d love to know what you think! Feel free to reach out on Twitter.