Anyone ever tell you that you were “in for a fixin’”? Probably not. That seems like something a grade school bully would have told my grandfather. Knowing my grandpa, it was most likely the bully that needed some fixing at the end of the day. Regardless, in the case of Tableau 9.0, we are all in for a fixin’, and I mean that in the best way possible.
If you haven’t had a chance to check out the Level of Detail calculations in Tableau 9 yet, welcome out of the cave! This is one of the important developments in Tableau’s recent history. These new calculations allow us to precisely choose the granularity we would like to perform an aggregation at.
I’ve noticed that a lot of people are curious to know more about how you would actually use these calculations. I want to provide one use case today to help get you thinking about how you could use this in your own context. I was recently working with a client who does sales development, and they wanted to be able to return an accurate count of how many leads they had worked. Their data looked something like this:
In essence, any activity that has one or more activities associated with it should be considered a worked lead. In the old days (i.e. 2 months ago) you might be able to write a calculation like this;
That would tell you whether a lead that had been worked, but it only worked properly if the Lead ID field was pulled into the view.
There was no way to return a count of leads where the Activity ID was greater than 0.
That grade school bully just walked right up to you in front of the girl you are crushing on and punched you in the face. However, with Tableau 9, you are no longer the spindly, nerdy Peter Parker who gets his face shoved into the dirt. You are the high flying, Kirsten Dunst kissing Spiderman who can lock that bully in a Honey bucket and roll him down a hill.
With the new FIXED calculation, you can determine the level of detail that you want to create an aggregation at. In our case we will create an aggregation at the Lead ID level that determines if a lead has at least one activity associated with it. If so, we’ll consider it a worked lead and count it. If not, we will return a null.
Finally, we will try our new calculation and find that 5 of our 11 leads have been worked (i.e. have at least one corresponding activity), exactly what we would expect by looking at the data from the first image.
It’s time to go out there and put your data problems “in a fix” ;-)
By Eric Parker
Posted by admin