Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Custom Sort by multiple criteria

Lesleyc
5 - Atom

Hi All, I am struggling to find a way to custom sort data - see example data.

 
Category Score
positive0.5574
neutral0.2732
neutral0.25
positive0.5912
negative-0.3612
positive0.7184
negative-0.1419
negative-0.2411

 

The scores range from -1 to 1.  I would like to sort the categories as in the example below to show the following:

Negative score smallest to largest, positive score largest to smallest and neutral score largest to smallest. 

I have considered assigning the number 1 to negative and 2 to positive etc. to achieve custom ordering for the categories, though still need to order the scores as mentioned above.

 

Category Score
negative-0.3612
negative-0.2411
negative-0.1419
positive0.7184
positive0.5912
positive0.5574
neutral0.2732
neutral0.25

 

Thank you.

3 REPLIES 3
Rags1982
10 - Fireball

Hi @Lesleyc 

There's two options. Either, do as you said by naming Positive as 1, Negative as 2 etc, then using a sort to sort by this 1,2,3 column AND by value descending. 

Or, you could split them into 3 groups: Positive, negative, neutral, then sort these groups individually, then union them all together. 

Hope this helps. 

ChrisTX
15 - Aurora

Since you want

  Negative score smallest to largest, positive score largest to smallest 

 

you'll need to split the data stream using a Filter tool, then use separate Sort tools in each data stream, then a Union tool.

 

Chris

Raj
15 - Aurora

PFA

Labels