Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Sort Multiple Columns

r4upadhye
11 - Bolide

Hi,

I'm working on some sorting requirement.

Data looks like this:

Column1Column2Column3
Aa11
Ab12
By13
Bz14
Az15
Ay16
Ba17
Bb18
Cz19
Cy20
Cb21
Ca22

 

I want to custom sort left two columns such that result would be:

 

Column1Column2Column3
Ab12
Ay16
Az15
Aa11
Ba17
By13
Bz14
Bb18
Ca22
Cb21
Cz19
Cy20

 

Thanks in advance for your input.

---

rahul

2 REPLIES 2
JohnJPS
15 - Aurora

Hi @r4upadhye

For sorting that requires anything other than a simple ordering, I would generate a "SortOrder" variable, and calculate it based on whatever rules I had in mind; then just order based on that variable.  It appears that you've got a pretty wild ordering in mind; if you can explain the rules you used to come up with that order, we might be able to assist with expressions to calculate it.

Hope that helps!

John

 

 

r4upadhye
11 - Bolide

Thanks John.

I had to sort based on two text columns.

I came with with my solution, sharing here:

first i sorted A, B, C by assigning them 100, 200 and 300

next i assigned a, b, y, z those values such as 1, 2, 3, and 4 based on my custom sort logic.

Finally i added 100, 200, 300 with 1, 2, 3, 4 to get final numbers as 101, 102... and so on.

my last step involved sorting on the combined number.

thanks for ur concern,...

Labels