Thursday, 27 February 2014

Taking a look at what the minimum wage means across the USA

Recently my colleagues at Slalom Consulting have launched a great concept called Viz for a Cause - which is designed to be a place to gather visualization pieces that address both global and local issues. The hope is that in doing so we can more easily share the stories and the evidence around the things we believe are important - and in turn engender debate, discussion and engagement.

The launch of this site caused me to to consider my own viz output and I decided to attempt to address an issue I think is very important - that of the minimum wage, which is low in many places but in my opinion is scandalously low in the place I now live - the very expensive city of New York.

This has been quite a change and a challenge for me as I usually produce work on my blog that could be considered 'fun'. And its ended up being quite text heavy. But I hope you find it interesting and thought provoking. As usual, comments are welcome.

Sunday, 16 February 2014

Tableau Tip - The End of Time.... series based calculations

OK time for another little Tableau tip which might come in useful. This is one I now use all the time. The idea of using an index to hide time based values was first brought to my attention about 18 months ago by Tom Brown of The Information Lab (if I remember correctly - there is a chance it was Craig Bloodworth or Andy Cotgreave but I'm pretty sure it was Tom).

The situation is this: You've got a time series based table calculation going on that you are interested in showing, something like a running total, YTD total or difference from last month, however you don't want to show all the data - instead you only want to show the latest month.

Your starting position might look something like this below, with year, month, sum of sales, monthly difference in sales and running total.

Now lets say you only want to show the latest month, in this case December 2013. Well the first thing that springs to mind might be to filter, but that messes with the calculations PLUS its not going to automatically update to the latest month when the data updates:

Now the next idea you have might be to HIDE the 'non latest month' data, and that will solve the issue of the filters messing up the table calculations, but its still going to leave you with a problem when you get a new months worth of data you want to automatically show. So this is what you can do....

First create an index field:

now make this discrete

then pop the index field into your viz just after the 'month' pill

now comes the clever bit. To show just the latest month you want to hide everything else. To do this you need to make the Index value along side the latest month be equal to something unique and that will stay constant as the data updates, and then hide everything else. One way to do this is to sort year and month descending, and then highlight all the index fields that are not 1 and click hide. This can work fine for calculations of difference along time BUT does not work for running sums as it flips the year around to calculate from December running to January. So the safe bet is to take the following step:

Create another calculated field that looks like this

this creates a Boolean True/False variable that you can now add to your view and hide the Falses:

then unclick 'Show Header' for both 'index' and 'index match'

and you are left with the view you want, which will automatically update to the latest month as your data refreshes:

And then you can do what you want with that view, change the aliases, add it to a dashboard etc....

If anyone has an alternative approach to this I would love to hear what it is, as with so many things in Tableau there are probably multiple ways to achieve the same goal.