Sort by multiple keys


#1

Hello, If I have a list of elements how can I sort them by more than one criteria? For example: I have a list of n walls and I want to sort them by floor, then by length, then by volume. Thanks


#2

You just do what you’ve yourself outlined

  1. first, sort by floor

  2. then, sort by length

  3. then, sort by volume

I’m quite sure you intend to do something else, would help if you illustrate your intent.


#3

Thanks Vikram,

I want something that goes similar to the example below, I almost got there, but I want it for 3 different parameters.


List sort by key by z then by y then by x location
#4

Actually, to preserve the proper hierarchy, you might need to sort them in reverse - first by volume, then by length and finally by base level. Try the following example:


#5

Great, that’s what I wanted.

Thank you.