Alteryx Designer Desktop Discussions

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

Dynamically Sort Descending on Last Column and Add Rank Column

ShaneGraham
7 - Meteor

I need to sort on the last column of input, which is dynamically created based on a crosstab. Playing around I can identify the column name of the last column easily enough, but couldn't quite figure out how to sort on it.  Also I need to add a Rank column and make it the last column.  Please see attached sample input and workflow.  Thanks.

 

DynamicSort.png

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

Two ways occur to me (both use a FieldInfo tool to get name of last column):

 

1. Transpose and keep just the last column then use this to rank the results before joining back.2017-02-22_19-32-32.jpg

 

2. Sneakier... Rename the last column, sort and rank, and then rename back

2017-02-22_19-32-16.jpg

 

Sample of both attached

 

I expect the second method to be a huge amount faster on a large scale

ShaneGraham
7 - Meteor

Thank you for the quick solution.

Labels