Question #1 - Did I walk more or less in 2023 compared to 2022?

This is the first of a 52-week project to answer one question a week with Tableau. I will do my best to make each question as generically applicable to as wide of an audience as possible. Some weeks will be personal, like this one!

Each question will be accompanied by a blog post explaining my chart choices and calculations used.

Why do this? There are loads of community projects to learn how to recreate and redesign visualizations. There is Tableau Public Viz of the Day for design inspiration. What I don’t see a lot of is, “how do I answer questions that I have in Tableau?” My philosophy is that the world would be a lot more harmonious if we backed our opinions with fact (or let them go when we can’t). It is easier than most people think!

For this week, I was curious to see how far I walked in 2023 compared to 2022. I did not set a goal to walk further in 2023 and really had no idea how it compared. The answer was a bit depressing!

How to best depict this information?

At first, I was thinking of using either a bar-in-bar or bullet chart. Neither of these work because the question was how it compared and less about the distance walked. The bar-in-bar made my (lack of progress) seem not so bad!

In the end, I decided to go with a waterfall chart. This allowed me to show the difference for each month, in a running - or cumulative by month - manner with a total bar at the end. I have to admit that the chart was a bit confusing in the end. I expect almost all the confusion came from the fact that every month was negative to the same month the year before! Better set a goal for this year.

I decided to add a few BANs at the top of the dashboard to draw out total walking distance with a delta to 2022 as well as the best and worst comparative months. The last design choice was to centre-justify all the titles. I usually prefer left-justifying everything. Why the exception? The BANs looked better - to me - centre-justified and I wanted to centre-justify text (on a reference line) indicating the zero-axis. It seemed to be missed unless it was centre-justified.

Overall, I don’t love it, but I think that has more to do with the data. Live and learn. The point of this project is to answer questions quickly and no belabour design choices.

So, what calculations did I use:

For 2023 walk distance:
SUM(IF YEAR([Date]) = YEAR({MAX([Date])})-1 THEN [Distance walking / running(km)] END)

For 2022 walk distance:
SUM(IF YEAR([Date]) = YEAR({MAX([Date])})-2 THEN [Distance walking / running(km)] END)

I wanted both of these aggregate calculations as their own measures to make it easier to play with dual-axis charts and to do comparison between the two years without needing to use table calculations (i.e. I wanted the numbers independent of the viz level of detail). I also wanted them both to be somewhat dynamic in case I wanted to use the same workbook next year.

To create the waterfall chart, I used a quick table calculation and a negative of the difference between the distance calculations on size.

To create the best and worst months, I created a sheet with all the months and the difference in distance sorted from smallest to the largest. I duplicated the sheet. For the best month, I used a calculation - FIRST()= 0 - and used it as a filter set to true. For the worst month, I used - LAST()=0 - and used it for a filter set to true. Why this approach? Understanding Tableau order of operations, table calc filters are not really filters at all but a programmatic way to “hide” data that is in the view.

You can go here to see and download the workbook. I hope you found this useful and 51 (hopefully!) questions to go for this year. Suggestions on both the visualizations and questions you would like to see answered are welcome!


Previous
Previous

Question #2 - Is gold a good investment during inflationary times?

Next
Next

F1 Standings - Fun with Animations, Symbols, and Table Calcs