The seventh week of #MakeoverMonday in 2018 offered participants the opportunity to reviz a great small-multiple visualisation by @RodyZakovich. As tends to be the case, I went with my first instinct and created this viz, which makes use of a common baseline to see which sports have resulted in the greatest number of medalists since the Winter Olympics began.
Seconds after posting, I saw @VizWizBI had submitted a similar (better!) chart using similar principles. His viz was based on another of Rody’s tips and Rody’s approach is one that has escaped me until now, so now seems like a time to take a look.
I’m not entirely wet behind the ears with step lines, as I’ve used a prior version of the technique from @TableauTim:
As far as I can tell, step line hacks have a limited shelf life as Tableau 2018.1 is going to deliver this as an out-of-the-box line chart option:
Let’s see what Andy did.
It’s a pretty busy worksheet, so there’s going to be a lot to look at here. I’ll start with the continuous Dimension on the Columns shelf:
A nice easy start. A basic Level of Detail calculation to subtract the first year of competition for each Country from the current year. But why is it stored as a Dimension rather than a Measure? Because that way, you avoid any aggregation (SUM, MEDIAN, COUNT) etc.
Andy has gone down the dual-axis route on Rows, which can be determined by looking at the shape of the Green (Continuous) Pills on the shelf:
The back-to-back vertical line indicates that this is a dual-axis. The first Pill makes use of the functionality to add multiple Measures to a single Mark, and this is the core component of Rody’s stepped line technique. The two Measures Andy has picked up are [Cumulative Medals] and [Next games along Years Since First Games]:
A straight-forward Table Calculation to calculate the RUNNING_SUM of Medals. The second calculation is as below:
Here, the calc is actually picking up the prior Year of competition’s RUNNING_SUM of medals, so the title of the calc is a bit misleading. If you plot these Measures independently and dual-axis them, you end up with this:
Not what we’re after at all because we end up with separate values, whereas we want to force Tableau to plot two values in each partition. Hence the use of Measure values. Let’s rewind a bit and see exactly how Andy had this configured:
If you look carefully, you’ll spot the inclusion of INDEX() on Path. Without this calc, the two values are being connected by Measure Names along each month and so they appear as distinct Measures. If I look at Germany in isolation, here is how the INDEX() calculation is working to form a single line:
The final calc on Rows is just to plot the dot at the end of the lines. It’s a nice detail to add as it acts as a sort of minimalistic cue which draws attention but is subtle enough not to be distracting:
OK, let’s look at the other “bits” knocking about on the worksheet. On Filters we have a dynamic computed Set:
So the view will adapt based on the Dimension members selected in the filters to always return the 5 nations to have accrued the greatest number of medals for the relevant data intersections.
Next, you’ll observe the grey filters for Gender, Medal and Sport. The grey colouration denotes that these Dimension filters have been added to Context. If this step wasn’t taken, then the Level of Detail calcs behind the scenes wouldn’t update and you’d only see the overall medal haul per Country, regardless of what filters were set, and the y-axis will remain fixed as it continues to plot those overall medal counts:
Andy always leverages a sneaky trick here and there too, and I was observant enough to find a couple of them. The first is an axis buffer calculation for the medal count:
It simply adds 10% to the highest medal count in the view, which gives breathing space on the y-axis. Andy pops it on the view as if it’s on the Tooltip card, even though it isn’t included in the Tooltip. Weirdly I noticed a change to its impact if it is moved to Detail instead. Not sure what the reasoning is behind that, but here’s the difference:
An equivalent calc is also evident for the x-axis:
Same principle as before, but referencing time rather than medals. This calc is required on the x-axis for some of the newer events, such as snow-boarding. To leverage it, it is utilised as a reference line:
If it wasn’t included for snow-boarding, the horizontal space becomes compressed:
As I get more comfortable with Tableau, I’ve come to appreciate that it’s the ability to recall little tricks like this which really enhances the overall polish of final dashboards.
That’s it! Nothing new for people who have read Rody’s version (which I linked earlier), but if, like me, you need to absorb something two or three times before it sticks, then hopefully this will be the straw that breaks the camels back!