Alteryx Sort Tool

The Alteryx sort tool helps you sort the source data based on one or more columns in ascending and descending order. To demonstrate the Alteryx sort tool, we used the below Customer_Country text file.

Text File 0

First, drop the Input Data Tool, and within the Configuration tab, click on the down arrow button to connect to a Customer_Country Text File.

Choose Text File for Input Data 1

Once you select the text file, the following Resolve File Type window will open. We have chosen the Read it as a delimited text file option and set the Comma.

Check Delimiter Options and Click Ok 2

Alteryx Sort Ascending and Descending

Within the Favorites tab, drag the Sort tool to the canvas and add the Input Data tool output to the Sort tool. We can select the field or column names within the Alteryx Sort configuration tab and the sorting order (Ascending or Descending).

Alteryx Sort Ascending and Descending 1

If you click on the down arrow, you can see the list of available columns to perform sorting.

Choose the Column Name 4

We selected the Education Column and the Sort order as Ascending. It means the Alteryx sort tool has to sort the Customers by Education in ascending order.

Alteryx Sort Tool - Ascending and Descending 5

Run and see the sorted output.

Alteryx Sort Tool - Ascending and Descending 6

This time, we added an occupation column in ascending order. As you can see, Customers are sorted by education and then occupation.

Multiple columns in Ascending 7

We can also use the combination of ascending and descending order. Alteryx sorts the customers by eduction in ascending and country names by descending order.

Multiple Columns 8

When we try to sort the Sales column in ascending order, it has given a strange result. It is because the sales column is of string type.

Alteryx Sort Tool - Ascending and Descending 9

If you want to sort the string column with numeric values, you can try using the Alteryx dictionary order option. It might give the correct result but is not recommended.

Alteryx Sort Descending 10

Let me show you a list of languages supported by Alteryx dictionary order.

Use Dictionary Order option 11

As I said earlier, to sort the numeric values, we have to change the column type to numeric. We added the Select tool in-between the Input and Alteryx Sort tools and changed the Sales column to double.

Alteryx Select tool 12

Now you can see the Sales columns sorted in ascending order.

Sales in Ascending 13

Here, the sort tool sorts the customers by country in ascending and sales by descending.

Alteryx Sort Tool - Ascending and Descending 14