Monday, January 28, 2013

Sorting your Data in Tableau

Today, we will look at ways to sort your data in Tableau.  Sorting is a simple way to increase the effectiveness of your visualizations, especially when paired with other techniques, such as sets and filters.  Let's start by creating a simple sorting.  As usual, we will use the Sample Superstore sample data set in Tableau.

Step 1:
  • Create a Worksheet
Total Shipping Cost by Container Type
By default, Tableau sorts the field values in data source order, starting with the first field.  This means that whichever value comes first in the data source, will come first in the graph.  This is not likely to be helpful for any of your business decisions.  So, let's sort the data from largest value to smallest value.

Step 2:
  • Right-Click "Container" in the Rows Pane and Select "Sort..."
  • Under "Sort Order", Select "Descending"
  • Under "Sort By", Select "Field"
  • Then, Select "Shipping Cost", "Sum"
Total Shipping Cost by Container Type (Sorted by Total Shipping Cost)
Now, we can see that "Container" in the Rows Pane has been Bolded.  This is how you can tell if a field has been sorted.  This sorting is quite simple.  Let's look at something more complex.  Let's sort the shipping costs based on how much Total Order Quantity they have, without displaying Total Order Quantity in the graph.

Step 3: 
  • Open the "Sort" window for "Container"
  • Under "Sort Order", Select "Descending"
  • Under "Sort By", Select "Field", Then "Order Quantity", "Sum"
Total Shipping Cost by Container Type (Sorted by Total Quantity)
We can see that some items have moved higher up the list.  This is great because it allows us to see what container types contain cheaper items, without having to create a calculated field.  While sorting is simple in-and-of itself, it is an invaluable tool for increasing the effectiveness of your visualizations.  Thanks for reading.

Brad Llewellyn
Associate Consultant
Mariner, LLC
llewellyn.wb@gmail.com
https://www.linkedin.com/in/bradllewellyn

No comments:

Post a Comment