forums
Use these forums to ask questions and discuss Tableau.
percentage of (sales units of Month A of year Y/ sales units of Month A of year Y-1)
Hi, I am very new to Tableau. Hope my questions do not sound too stupid.
i am trying to display the calculation of the percentage of (sales units of Month A of year Y/ sales units of Month A of year Y-1)
I found the function call year over year growth but the year over year growth seems a little strange because some of the data get blank after the calculation (eg: 2006 Q4 sales unit % for 3 months) and some get wrong negative values (eg: sales unit of 2006 September -> 2189 compare to 2005 September ->1990, there is an increase of 10 % but Tableau show a negative -28.91%).
I attached a printscreen showing my base year 2005 start with May 2005 and it seems like Jan 2006 is comparing with May 2005.
Do anyone can advice me how to get the comparison for May 2006 with May 2005 while leaving blank for Jan 2006 to Apr 2006 since there are no comparison available?
I am also trying to do (sales units) / Grand total of sales units. I can display the grand total by doing Table-> Grand total for rows, but I am not able include GrandTotal in the calculation field. Appreciate if any solution is available. Thanks a lot.
| Attachment | Size |
|---|---|
| Tableau Calculation Qn1.JPG | 145.73 KB |
Comments
Andy, not a stupid question at all. This is a very confusing aspect of Tableau that we are working on fixing.
Currently, when you do difference calculations like this, Tableau does not recognize dates specially. So, what it's doing is comparing the '1st' value in year 2006 to the '1st' value in year 2005. In this case, it's comparing 2006,Q1,Jan with 2005,Q2,May. This is because 2005,Q1,Jan doesn't exist in your data. If it did, we'd do the right thing.
We hope to make Tableau smarter in the future and recognize dates so that we'll do the expected thing. Until that time, you need to pad your data with NULL entries for the missing dates so that the difference calculation will come out correctly.
As for the sales units / grand total of sales units: You need to do a 'Percent of Total' table calculation and for the 'Calculate the percent difference within:' set it to 'Table (Across then Down)'.
:)ross
: -
Thanks for the update Ross. It works after adding blank records for the missing months. Hope that Tableau can get this problem fixed soon.