How to sort a table based off status text values?

Hey @Ava_Hernandez, welcome to the Community!

First, sorting by a separate column is, in fact, the simplest and most straightforward way to go about it.

If Status is a lookup column and there’s a table of statuses (three rows for each), add a numeric column on that Statuses table, assign values 1, 2, 3 to your rows to designate orders, then add a column Status.Order on your original table to pull in those 1s, 2s and 3s, and sort by that column.

If Status is a simple list of text values, then instead of going through a separate table make a column in your original table that would calculate those 1s, 2s, 3s like this:

List("Top Priority", "Second Priority", "Completed").Find(thisRow.Status)

Then again sort by this new column.

Either way you need a numeric column to sort by, and it should be you who sets the logic of which number is assigned to each row (i.e. by checking the order of this row’s status).

There’s also a trick to force arbitrary order on alphabetic sorting but you don’t need to do this here. Linking just for the record. You’d need this solution for hacking group sorting.


Second, keep in mind that any grouping you have in your table will override sorting on non-grouped columns. I.e. if you’re grouping by project and Project A has all tasks Completed, and Project B has all tasks Top Priority, this will not reorder groups to put Project B over Project A. Sorting on non-grouped columns only applies on rows within each group individually.

2 Likes