How to build this chart type in Tableau

2017-08-26 20_09_07-Track National Unemployment, Job Gains and Job Losses - WSJ.com

The chart above shows a dot for each sector for each month with the percent change from the previous month on color.

Here is a screenshot of a similar worksheet in Tableau using Superstore Sales data:Screen Shot 2017-09-16 at 5.18.10 PM

Obviously, there is plenty more that can be done with formatting but that is beyond the scope of what I want to share, which is the calculations behind this type of chart:

[y-axis]
if [Difference in sales] >= 0
then [Rank of difference if positive]
else -[Rank of difference if negative]
END

[Rank of difference if positive]
RANK_UNIQUE([Difference if positive],’asc’)

[Rank of difference if negative]
RANK_UNIQUE([Difference if negative])

[Difference if positive]
if [Difference in sales] >= 0 then [Difference in sales] END

[Difference if negative]
if [Difference in sales] < 0 then [Difference in sales] END

[Difference in sales]
ZN(SUM([Sales])) – LOOKUP(ZN(SUM([Sales])), -1)

Note that [Difference in sales] is difference and not percent difference.  This is just because the percentage differences are too skewed in this dataset to look good in the resulting chart.

The last step is to properly configure the table calculations.  Right-click the “y-axis” pill in the rows shelf and select “Edit Table Calculation…” Note the different values under “Nested Calculations” in the three screenshots below.  You have to set each of them independently for the view to work. Also note that the order of the checked items under “Specific Dimensions” must be identical to what I have below when more than one item is checked:

Screen Shot 2017-09-16 at 6.31.44 PM

Screen Shot 2017-09-16 at 6.32.55 PM

Screen Shot 2017-09-16 at 6.33.23 PM

And the final step is to configure the table calculation for “Difference in sales” on the color shelf:

Screen Shot 2017-09-16 at 6.37.29 PM

Here is a link to the workbook ==> Link

Enjoy! 🙂