Ranking a list - Maximum to Minimum

Hey, Ive a list of people [A,B,C,D] and a list their respective score [0.24,0.26,0.21,0.28]

I want:
1- to rank these people according to their respective scores.
2- a list with sub lists [A,B,C,D] , [0.24,0.26,0.21,0.28] and [3,2,4,1]

I am using the SortIndexByValue node, but its giving me minimum to max values. and all other sort nodes are not working for me.
please help, thanks

Use a List.SortByKey to sort the items ([A,B,C,D]) by their scores. This will be lowest score to highest, so if you want it highest to lowest use a List.Transpose on the outputs.

Then you can build a range from 1 to the length of the sorted list - this will be the rank of the individuals. List.Create will join the three values together.

1 Like

instead of List.Transpose I would use the List.Reverse. for this case

2 Likes

here is the solution! Cheers!