Sortable Pie Wedges (A Guest blog by Ray Givler)

Vignesh Suresh
3 min readJun 17, 2023

The following is a guest blog post from Ray Givler. Ray works as a Senior Decision Support Consultant, who uses Tableau to create self-service analytics to yield actionable insights to improve efficiencies at Helion, one of the largest blended health organizations in the U.S. Ray always researches and comes up with great stuff in Tableau, which is commendable. This blog post is being presented as a guest blog on https://vigneshs4499.medium.com/.

If you’ve ever needed to display marks in more than one order, this dashboard can help you. This approach not only works for pie wedges but can also be applied to overlapping scatterplot points to bring different marks to the font.

These instructions assume the analyst:

✅ isn’t strictly anti-pie

✅ is okay with multiple pie wedges

✅ has a use case for presenting the wedges in more than 1 sequence.

The sort of the pie wedged hinges on a few features: the dimension on the color button of the marks card a parameter of the choices for sorting a calculated field to process the parameter selection.

Creating a Parameter

Create a Parameter called “Select Wedge Sort Order” of type String with 4 entries.

Creating a Calculation

Create a calculated field called “Wedge Sort Order” that processes the above parameter to return your target measure or dimension sorting criteria. One would think that a positive sort value would sort clockwise, but nope, it’s reversed! Make sure to set this measure to Continuous.

Usage of MAX()

Tableau will not allow (at least in my example) nested case statements on a sort variable, so those have to be offloaded to two more calculations (below). Note that we take the MAX above because we need an aggregation, and we want a value that is not influenced by the number of rows of data.

Build the Visualization

Set the Mark Type to Pie. Put “Ship Mode” on Color, “SUM(Sales)” on Angle, “Ship Mode” on Text, “SUM(Sales)” on Text, and “Wedge Sort Order” on Detail.

Right-click “Ship Mode,” select Sort, choose “By Field,” set the sort order to Ascending, and select “Wedge Sort Order” as the Field Name. Make sure the aggregation is set to Custom. If your variable is not on the field list, make sure it is Continuous.

If you want a different order for each selection, put “Sub-category” on Filters and use only Binders. Otherwise, “Counter-Clockwise” and “Ship Mode Priority” will likely have the same sort of order. Adjust the size, color, and tooltips as you see fit. If everything goes well, you should see the following:

After playing with the Parameter, it looks as shown below

Make sure to follow Ray on LinkedIn. Check the workbook here.

Thank you for reading. Connect with me on Twitter and LinkedIn, and check out my Tableau Public profile for more visualizations.

Vignesh Suresh

--

--