community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Custom sort

Meteoroid

I am trying to re-arrange my output rows into a certain order.  The only tool I can find related to this is Sort which only gives the options of ascending or descending - can I specify my own order anywhere?

Pulsar

Create a copy of the column you want to sort on and prepend the values with a number that represents your sort order. Then sort by that column.

Aurora

Hi Sarah

 

Alteryx presents you with the same options available in SQL queries, i.e.

 

Select colA,colB from table1

Order by colA asc, colB desc;

 

This should be enough to build any kind of sort you require.

 

The Sort tool also gives you the option to sort by dictionary order.  This means that numbers get sorted alphabetically.

 

1
2
10
22

 

becomes

 

1
10
2
22

 

You can also select the dictionary order to use, if your data has accented characters that need to be treated in a special way.

 

Dictionary order.png

 

 

If you need to sort by another attribute of the data, for example word length, you'll need to define a new field as shown below

 

 attribute order.png

 

 

Can you give an example of a custom sort that you're trying to reproduce

 

Dan

Labels