Sort FILTER results It would be nice if this...

Colin1
New Member

Sort FILTER results

It would be nice if this could also suggest how to sort the list of references using one the columns in the table it was filtered from.

Is there a simple way of doing so? Or an example? For example a table might have a column like SEQUENCE_ORDER. How could it be used to sort the result of the filter? Might it have to be done before the FILTER expression is applied to the table?

0 5 1,427
5 REPLIES 5

SORT(FILTER(table-name, select-row),TRUE)

help.appsheet.com - SORT() SORT() help.appsheet.com

Use ORDERBY().

ORDERBY(FILTER(โ€ฆ), โ€œSEQUENCE_ORDERโ€)

The first argument is a list of row references (as generated by FILTER() or by a SELECT() returning key column values).

The second argument is the name of the column in the table referenced by the rows in the first argument to sort by.

An optional third argument is a Yes/No value (TRUE or FALSE) to indicate sorting direction: FALSE (the default) for ascending/A-Z/0-9, or TRUE for descending/Z-A/9-0.

Additional sorting columns and sorting directions can be included in pairs.

SYNTAX

ORDERBY( rows , column [ , descending? [ , column ] ]โ€ฆ )

EXAMPLES

ORDERBY(Employees[EmpID], โ€œLast Nameโ€, FALSE, โ€œFirst Nameโ€)

ORDERBY(FILTER(โ€œEventsโ€, ([When] <= TODAY())), โ€œWhenโ€, TRUE)

Iโ€™m having a hard time having the RESULTS display appropriately for my situation here.

ORDERBY(FILTER(โ€œmembersโ€,TRUE),[COMBINEDN],FALSE)
This filters my referenced email to user (combinedN) list in alphabetical order for selection, however when I select two names I need them in a certain order based on another columnโ€ฆ

I need to have the RESULTS ordered by a true/false column in the same sheet [PC] where the TRUE takes the first โ€œspotโ€ of 2 potential results.

No matter what iโ€™ve tried today, the order of the results only comes back with the order of the users selected in the ref.

ORDERBY(FILTER(โ€œmembersโ€,TRUE),[COMBINEDN],FALSE , [PC] , TRUE)

By the way, you might find better information on threads that arenโ€™t 3 years old.

opps Didnโ€™t even see that. Thanks Iโ€™ll give this this a try.

Top Labels in this Space