I wanted to have some fun, so I put together a quick tutorial for creating a Wilkinson Plot in Tableau, and within 10 minutes or less.
Note: This is an alternative type of data visualisation, and sometimes pushed for by clients. Please always look at best practices for data visualisations before deploying this into production.
Data
We will start by loading the following data into Tableau Desktop / Tableau public.
Note: If you have Tableau Desktop, you can use the Sample data source, but if you are using Tableau Public, download and load the following data source.
Calculated Fields
We only need to create the following Parameters and Calculation Fields:
@Metric Bin Size Parameter
- Set Name to @Metric Bin Size
- Set Data type to Integer
- Set Current value to 250
@Metric Parameter
- Set Name to @Metric
- Set Data type to String
- In Allowable values select List and enter the following values:
- Sales
- Profit
- Quantity
- Set Current value to Sales
@Dimensons Parameter
- Set Name to @Dimension
- Set Data type to String
- In Allowable values select List and enter the following values:
- Sub-Category
- Product
- State
- Customer
- Set Current value to Customer
Dimension
IF [@Dimension] = "Category" THEN
[Category]
ELSEIF [@Dimension] = "Sub-Category" THEN
[Sub-Category]
ELSEIF [@Dimension] = "Product" THEN
[Product Name]
ELSEIF [@Dimension] = "State" THEN
[State]
ELSEIF [@Dimension] = "Customer" THEN
[Customer Name]
END
Metric by Dimension (bin)
INT({ FIXED [Dimension]: SUM([Metric]) }/[@Metric Bin Size])*[@Metric Bin Size]
Index
INDEX()-1
Metric
IF [@Metric] = "Quantity" THEN
[Quantity]
ELSEIF [@Metric] = "Profit" THEN
[Profit]
ELSEIF [@Metric] = "Sales" THEN
[Sales]
END
TC_Max per Bin
WINDOW_MAX([Index])
Y
[Index] - ([TC_Max per Bin]/2)
With this done, let us start creating our data visualisation.
Worksheet
We will now build our worksheet:
- Change the Mark Type to Circle
- Drag Order Date onto the Filter Shelf and filter to 2017
- Drag Dimension onto the Detail Mark
- Drag Metric by Dimension (bin) onto the Columns Shelf
- Drag Y onto the Rows Shelf
- Right-click on this pill, go to Compute Using and select Dimension
If all goes well, you should now see the following:
Note that we have Metrics by Dimension (bin) as Discrete, you can exploring turning this into Continuous. We will now adjust the cosmetics.
- Drag Metric by Dimension (bin) onto the Color Mark; make sure that this is a discrete.
- Hide the Axis Headers
- Hide the Grid Lines and Zero Lines
- Hide the Row and Column Dividers
- Adjust the Tooltips
You will want to have the following:
and boom, we are done with this Tableau Quick Tip, and I hope you had some seriously good fun; as always, you can find my data visualisation on Tableau Public at https://public.tableau.com/profile/toan.hoang#!/vizhome/WilkinsonPlot/WilkinsonPlot
Summary
I hope you all enjoyed this article as much as I enjoyed writing it and as always do share the love. Do let me know if you experienced any issues recreating this Visualization, and as always, please leave a comment below or reach out to me on Twitter @Tableau_Magic. Do also remember to tag me in your work if you use this tutorial.
If you like our work, do consider supporting us on Patreon, and for supporting us, we will give you early access to tutorials, exclusive videos, as well as access to current and future courses on Udemy: https://www.patreon.com/tableaumagic