In a previous post I shared how even a small tweak to a dataviz can change the perspective of the data story. The example I gave demonstrated how a view that used absolute time (with date defining the axis) presents a different story and highlights different insights versus a similar view that used relative time (age defining the axis). I also teased that I’d share a Tableau workbook some details around how the views were created. So, here it is!
(clicking a mark should navigate to that post, but you may need to enable pop-ups in your browser)
I encourage you to download the Tableau Public workbook above and you can deconstruct it to see how various views were created. And, I’ll also walk through some of the examples below.
This simple view shows a running total of page views for each blog post on VizPainter.com. You’ll notice that Pageviews was placed on the Rows shelf as an aggregate (SUM) and then a Quick Table Calculation was applied (Running Total). Date was dropped onto Columns and the Week date value option was selected from the drop-down. (by the way, if you struggle with the date options, as I used to, then check out “Dates in Tableau Make Me Want to Tear My Hair Out”). Post was dropped onto the Detail shelf so that you get a line for each individual post.
Now, it may look like a tangle of lines (there are a lot of posts!). It would be a great place to implement the data highlighter demonstrated at TC15. But until that feature drops, I’ll do a little cleanup:
The following steps are simply what I chose to do to highlight some of the posts. They are given as an example of what you might do:
And, as previously noted, the view has some advantages when it comes to understanding when things happened based on an absolute date/time scale. But it is more difficult to compare the rate of growth because each line has its own starting place.
One thing that has fascinated me for a while now is that a small change to an existing dataviz can reveal new perspectives and insights. Such is the case when we simply change the absolute date/time scale to a relative scale (the age of the post).
Now, it is a minor change to the view, but there are a few steps to take in Tableau:
You’ll notice the Level of Detail calculation (LOD calc) that returns the first date in the data for each Post and then the DATEDIFF that calculates the difference between that first date and the Date for each record of data. That gives us the age of each post for every date in the data. I chose to take a minimum of the results so that I wouldn’t double count when I have more than one record of data for a given post on a given date.
In the past, I might have used a table calculation instead of LOD calcs to index each point on the line and increment by one for each new date – but there are some drawbacks. The biggest problem is that any dates that are missing (yes, it’s hard to believe that there are some posts that don’t get visited each day!) won’t count for the table calculation – so the rate of growth for a given post might be skewed.
One important thing to note is that I have to ensure that the SUM(Pageviews) table calculation is specifically computed along Date instead of table across, since I’ve moved the Date field to the Detail shelf.
At this point, I really have a scatter plot – one point for each post and date based on its age and cumulative page views.
I might once again choose to filter to clear out some clutter – or wait for the data highlighter widget. But even this view starts to tell a compelling story: how fast did posts grow in popularity?
I really like the ability to animate in Tableau. The Pages shelf is probably the most underused feature and yet it provides a very powerful storytelling ability. I think there are a couple of reasons for this:
With my view, animation allows me to bring the absolute date back into the picture and hints at some connections between posts that are not apparent in the static view.
Creating the animation is relatively easy:
Now we have some playback controls and the ability to step through or play through each week.
Here’s a couple of tricks that aren’t very intuitive:
A few slight tweaks can really make it pop:
And now you have a view that gives even a slightly different perspective and tells its own story!
By the way, some people asked what I used to capture the animation. I used Camtasia. Wouldn’t it be great to export animated gifs directly from Tableau without using a 3rd party tool? If you’d like to see this feature, then you might vote up this idea: Allow export of animated gif from Pages shelf animation