Free Trial

Alteryx Designer Desktop Discussions

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

Sorting by highest number by unique group ID

csodesza
7 - Meteor

Hello,

 

I have a workflow where I parsed the numbers from the 'ID' column to the 'Version_EDIT' column. I am trying to create a formula where I can sort by the highest version in 'Version_EDIT' by unique 'ID' group. Anything less than the highest version, the number '0' should be applied in the 'Deployment' column and in the 'Comments' column should write 'lesser version'.

 

In the highest version rows, leave the 'Comments' and 'Deployment' columns blank (as is).

Base file(example):

IDVERSIONDeployment CommentsVersion_EDIT
5698-A14V3  3
5698-A14V2  2
5698-A14V1  1

 

Expected Output(example): 

IDVERSIONDeployment CommentsVersion_EDIT
5698-A14V3  3
5698-A14V20lesser version2
5698-A14V10lesser version1

 

Please see attached of my working file. Thank you!

5 REPLIES 5
DataNath
17 - Castor
17 - Castor

Hey @csodesza, how does this look?

 

DataNath_0-1667511964048.png

 

I've:

1 - Parsed the version number

2 - Sorted on this

3 - Found the max for each ID and re-appended this

4 - Done a couple of checks to see if the version # = the max for that ID

5 - If not, apply the Comments/Deployment requirements

6 - If so, left them blank

7 - Removed temporary 'Max' field used for logic

binuacs
21 - Polaris

@csodesza One way of doing this

 

binuacs_0-1667512059702.png

 

csodesza
7 - Meteor

@binuacs What about in the scenario when we have the same unique ID with the same version? 

 

For example, I'm receiving this output when implementing with your rules: 

 

IDVersionDeploymentComments
5698-A14V3  
5698-A14V30Lesser Version
5698-A14V30Lesser Version

 

Expected Output:

IDVersionDeploymentComments
5698-A14V3  
5698-A14V3  
5698-A14V3  

 

Essentially they should all be null values since it can't recognize a higher version with that unique ID.

 

Much appreciative of your help as always!

 

 

binuacs
21 - Polaris

@csodesza updated the workflow and attached. can you try now?

 

binuacs_0-1667514822590.png

 

csodesza
7 - Meteor

@binuacs @DataNath Thank you both very much! Both of your solutions worked and I now have two ways to approach this type of problem. Appreciate all the help! 😁

Labels
Top Solution Authors