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

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Community v19.6

Looks aren't everything... But the latest Community refresh looks darn good!

Learn More
SOLVED

Sort Multiple Columns

Alteryx Partner

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

ACE Emeritus
ACE Emeritus

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

 

 

Highlighted
Alteryx Partner

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