List.SortByKey

Hi,

I’m hoping this is an easy question.

I’m trying to sort this highlighted list so the Geometry.DistanceTo value are sorted from lowest to highest and keep their relationship with the “Size” in a combined list.

I think it’s solved with List.SortByKey, but I can’t get it to work.
Any tips?

Thanks

Using SortbyKey, feed the diameters into list, the distances into keys, then create a list with sorted list as item 0 and sorted keys and item 1. Should do the trick. Transpose that at the correct level to get the diameters and distances next to each other in the same sublists if that’s what you’re after.

1 Like

hi @Jack

do you really need 3 levels for the list?

-biboy

Hi guys, thanks for the replies. @Hamish,
Is this what you meant?

@blsalvio I’m not sure what the implication on the levels means here.

You can also try this method:

1 Like

Hi @Jack,

You can change @ListLevels to sort by sublist:

2 Likes

Thanks a lot guys. The solutions worked. The levels trick was causing the problem.