on 10-28-2016 12:54 PM - edited on 04-19-2023 08:09 AM by yhchen
This 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
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:
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 community@alteryx.com 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.
Additional Information
Click on the corresponding language link below to access this article in another language -
Portuguese
Spanish
French
German
Japanese
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?)
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:
Active
Inactive
Delete
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:
Active
Delete
Inactive
How can I assign the order of my prefrence?
Regards
Hey @rafialmadrid : did you get the answer to your question?
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.
Great article, thanks for sharing.
Great there is a function to sort the tables on how you would like them to be presented.
I see it can be useful in some of data, i work with you
TQ SIR
Interesting and very helpful. Thank you.
Interesting and very helpful. Thank you.
Great article, thanks for sharing
5-atom
cool
I see it can be useful in some of data, i work with you
Nice article! Never realized that adding an extra sort tool might increase the efficiency of the workflow.
Just wanted to point out that the last 2 screenshots in the articles would need to be swapped in order to align them with the description text.
I CAN SEE IT CAN BE HELPFULL IN SOME DATA.
best awesome
Love that pic!