Friday, October 28, 2016

Can I see the trend of my Top N categories in the latest month

Well.....Well....Well....there are no words to describe how immensely helpful the Tableau community is. Just reading some of the awesome viz blogs, tweet links and Tableau community itself can be a full time job...... if someone can pay my bills, I don't mind taking up this job full time.

So what made me to write this blog post? Recently I was tasked to create a dashboard that shows two things -

a) What are the top 10 categories based on their sales in the latest month. And how does their historical trend look like?
b) How about the categories that have sales withing a specific range during their latest month. What does their trend look like?

When I was tasked to answer the above questions, the first viz that came to my mind was the KPIs and Sparklines viz from Andy Kriebel (one of my virtual gurus for Data Viz). Thank you Andy for your awesome blog, Tableau Tips, MakeOverMonday and many many more.

Andy's tutorial helped me to build the first level of data viz which shows the State, Latest month Sales (KPI), and their historic trend Sparklines.



This is where it became little tricky. One of my requirements was to show only Top 10 States instead of ALL the states. So I replaced the Sorting calculation by a Rank calculation as shown below -



From here my first task became easy....All I have to do is apply the Rank calculation as filter.....and viola...... you can now narrow down the states and see their historical trend based on their positioning in the latest month.  BTW,while drafting this notes, I was going through the comments from Andy's blog post, and I noticed that Andy did mention about using Rank filter to narrow down the number of entries.  I spent couple of hours before I realized I should user Rank calc. Lesson learnt - Read through the comments as well that might give some more help.



Second request is, what if we wanted to show only those states that have Sales within specified range. For this, I created two parameters - Min Sales, Max Sales and finally a calculated field as shown below and apply the filter -



Here are the setting for the worksheet -



You can download the final workbook that achieves the following tasks -

1. Shows the Sales in the latest month by State
2. Allow the user to choose which states to be filtered based on their positioning.
3. Allow the user to choose the states based on their Latest month sales with in a specific range. 


HDMO........ (Happy Data Make Over)