cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
GoBlueByrd
Level: Powered On

Combining Sort and Complex Filter

Hello all .. hoping someone can help me with a formula that combines SORT and FILTER.

 

My gallery currently has the following formula to FILTER based on a dropdown selection.  The data that displays is sorted (by default) to be oldest first, but I would like it to display newest first.

 

If(Status_Filter.Selected.Value = "All", Filter('OS Projects', Archive = false), Status_Filter.Selected.Value = "Submitted", Filter('OS Projects', Project_x0020_Status.Value = "Submitted"), Status_Filter.Selected.Value = "In Process", Filter('OS Projects', Project_x0020_Status.Value = "In Process"), Status_Filter.Selected.Value = "On Hold", Filter('OS Projects', Project_x0020_Status.Value = "On Hold"), Status_Filter.Selected.Value = "Cancelled", Filter('OS Projects', Project_x0020_Status.Value = "Cancelled"), Status_Filter.Selected.Value = "Completed", Filter('OS Projects', Project_x0020_Status.Value = "Completed"))

 

For the life of me, I could not figure out how to integrate the SORT command in this formula.

Any help would be much appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Combining Sort and Complex Filter

Try this but change "SortByColumn" to the column name you want to sort by. The column name needs to be in double quotes.

 

SortByColumns(If(Status_Filter.Selected.Value = "All", Filter('OS Projects', Archive = false), Status_Filter.Selected.Value = "Submitted", Filter('OS Projects', Project_x0020_Status.Value = "Submitted"), Status_Filter.Selected.Value = "In Process", Filter('OS Projects', Project_x0020_Status.Value = "In Process"), Status_Filter.Selected.Value = "On Hold", Filter('OS Projects', Project_x0020_Status.Value = "On Hold"), Status_Filter.Selected.Value = "Cancelled", Filter('OS Projects', Project_x0020_Status.Value = "Cancelled"), Status_Filter.Selected.Value = "Completed", Filter('OS Projects', Project_x0020_Status.Value = "Completed")), "SortByColumn", Descending)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.
2 REPLIES 2
Super User
Super User

Re: Combining Sort and Complex Filter

Try this but change "SortByColumn" to the column name you want to sort by. The column name needs to be in double quotes.

 

SortByColumns(If(Status_Filter.Selected.Value = "All", Filter('OS Projects', Archive = false), Status_Filter.Selected.Value = "Submitted", Filter('OS Projects', Project_x0020_Status.Value = "Submitted"), Status_Filter.Selected.Value = "In Process", Filter('OS Projects', Project_x0020_Status.Value = "In Process"), Status_Filter.Selected.Value = "On Hold", Filter('OS Projects', Project_x0020_Status.Value = "On Hold"), Status_Filter.Selected.Value = "Cancelled", Filter('OS Projects', Project_x0020_Status.Value = "Cancelled"), Status_Filter.Selected.Value = "Completed", Filter('OS Projects', Project_x0020_Status.Value = "Completed")), "SortByColumn", Descending)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.
GoBlueByrd
Level: Powered On

Re: Combining Sort and Complex Filter

Excellent !!  Thanks for your help.