Combine Sort() statements in one formula?

It’s possible to combine Sort() statements using the Table UI, and to rearrange them to change sort priority. (see embedded View example)

Is it also possible to combine Sort() statements using only a formula? Chaining Sort() performs a total re-sort with each new chain. (see embedded Canvas formula example) This behavior makes sense, but then how to combine Sort() statements in a formula?

USE CASE: Organize lengthy list of options in a “Select list”.


NOTE: My eyes are loving the recently added formula parentheses context shading :grinning:!
@alden


Hi Ander,

When chaining sorts in formulas, each following sort has precedence over the previous.

So the formula you’re looking for is

[Sort Formula Combo Test].Sort(true,[Column 3]).Sort(true,[Column 2]).BulletedList()

This is the opposite of using table sort, where the top criteria have precedence. But the perceived difference is just a visual one.

The next sort works on top of the previous. The result you’ve got is simply because your Column 3 has only unique values.

4 Likes

Right you are @Dalmo_Mendonca! Thank you!

In case anyone else finds this topic and is looking for a more optimized (and more complicated) solution, I recommend reading this post.