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

Alteryx designer Discussions

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

Sort fucntion not working

Meteoroid

Hi,

 

I am trying to sort every column from the following table in ascending order.

BM TotalBM1BM2BM3BM4BM5BM6BM7BM8
-3312-48-90-165394-16-22
-3869-834-92-94-86-95-54
-95-8197-3510-56-651916
978525-86-8-406195-35
-59-87746788-60-4-56
1351155-46-7656-149554

 

After applying the sort function, only BM Total column is sorted properly.

BM TotalBM1BM2BM3BM4BM5BM6BM7BM8
-3869-834-92-94-86-95-54
-95-8197-3510-56-651916
-59-87746788-60-4-56
-3312-48-90-165394-16-22
978525-86-8-406195-35
1351155-46-7656-149554

 

The data type is Int32. Could you please advise what I am doing wrong here. Thanks in advance.

Pulsar

You can't do what you're describing with a single Sort tool. The Sort tool creates a hierarchy of sorting, i.e. sort by this field, then if there's a tie, sort by this field, etc. To do what you need, I'd suggest using Transpose/Crosstab:

image.png

Transpose puts all the values in a single column, Sort ascending, then create an ID field that counts which row each value is going to be on, and finally Crosstab back to the original format.

 

Hope it helps!

Quasar

Here is my solution for your case.  Hope this is helpful. 

 

workflow.PNGWorkflowResults.PNGResults

Meteoroid

Thanks for the reply. This workflow seems to only sort the BM total column. I was looking for a solution that sorts every single column.

Meteoroid

Thanks for the solutions. This worked perfectly!

Labels