Alteryx Designer

Definitive answers from Designer experts.

Tool Mastery | Sort

Alteryx Community Team
Alteryx Community Team

Sort.pngThis article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Sort Tool on our way to mastering the Alteryx Designer:


Often times in data preparation, the need for order in your records will arise. When that situation occurs, the Sort tool has your back. It’s just that sort of tool. Effortlessly arranging your records – be it alphabetical, numeric, or chronological in order – while not quite a mind-numbingly complex operation, has ample utility. Sorting your records upstream of many tools can even optimize processing time. The fairly simple use cases below are techniques that frequently pop up in the data blending trenches:



                                                  Sort Tool, left, helping an analyst take their shots


  • Enforcing order for consistent Multi Row Formula calculations (attached in the workflow Sort.yxzp)



  • Listing records in chronological order for reporting (attached in the workflow Sort.yxzp)

Using the Summarize Tool’s (master it here) “First” and “Last” actions are only useful when you know which records will be first and last. The easiest way to do that is to apply a quicksort:




  •  Order-based record selection (attached in the workflow Sort.yxzp)



Note: The Sort Tool also has a checkbox option to "Use Dictionary Order" that will sort beyond ASCII string characters. Using this feature will impact the speed of your sorts.


By now, you should have expert-level proficiency with the Sort Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at if you’d like your creative tool uses to be featured in the Tool Mastery Series.


Stay tuned with our latest posts every Tool Tuesday by following Alteryx on Twitter! If you want to master all the Designer tools, consider subscribing for email notifications.

9 - Comet

Thanks @MattD, great write-up.


Just wanted to note one thing that I found out today. If you accidentally check the "Use Dictionary Order", and are trying to sort chronologically, it can* mess up your sort order. I had this issue on a sort before Dynamic Input causing me to pick up the wrong file. I'm hoping we can have a date field override the Dictionary Order in a future enhancement, but not sure if that will happen.


I also haven't tested, but I would assume this would be an issue if you were trying to sort Chronologically and by a String, unless you used separate sort tools. 


*(did for me, maybe not always?)

5 - Atom

I think you left out the case where the user decides the order with a personalized list, for example, I have the following possibilities of status for an item:






If I want the inactives to be ordered above the deleted ones, the alphabetical order won't work as it will rearrange them as folllows:






How can I assign the order of my prefrence?




8 - Asteroid

Hey @rafialmadrid : did you get the answer to your question?

6 - Meteoroid

Hi @rafialmadrid:


Nice point, I think with the existing tools we can still achieve this behavior.

1. Use a formula tool to create this required priority and then sort the data on the basis of that column and finally deselect the newly created column using the Select tool.  

2. Create the custom priority with a text-input file and join the data. Sort the data on the basis of the priority column and finally deselect the newly created column using the Select tool. 


I do agree that such an option will be useful. 

8 - Asteroid

Great article, thanks for sharing.