cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Robertjde
Helper V
Helper V

Filter and Sort in a Gallery

Hello, everyone,

I want to filter my gallery by a range (line) and date, which I do with a dropdown box.
3 lines are written in my database per area and day (date), from which I want to sort the 3 largest losses from duration_1, duration_2, duration_3 (format text) with error text.

 

Filtering works well, but I don't know how to sort the columns according to the largest number and get the appropriate text from first_fault, second_fault, third_fault.

 

SortByColumns(Filter(OPS1_Entries_Verpackung;Title = Dropdown4_5.Selected.Result;StartsWith(Linie;Dropdown5_14.Selected.Result));"Schicht";["Frühschicht";"Spätschicht";"Nachtschicht"])

 

Filter_gallery.PNGFilter_gallery2.PNG

 

 

4 REPLIES 4
RandyHayes
Super User
Super User

@Robertjde 

Are you stating that you want to sort from the largest to smallest looking at all three columns (duration_1, duration_2, duration_3)?

Or are you wanting to sort in a hierarchy of those columns (i.e. duration_1 largest to smallest, then largest to smallest for each of duration_2?)

 

Also, you mention that the durations are text??

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Robertjde
Helper V
Helper V

@RandyHayes 

I need the top 3 from all columns and rows. and then sorted from large to small.
In the example it would be 44, 30, 15
Unless a larger value is stored in another column, e.g. Duration_2

RandyHayes
Super User
Super User

@Robertjde 

So to be clear on it...

Given your picture of your data and the three records shown (numbering them 1 through 3), the sort order would be: 3, 1, 2

In those records, it would all be determined by the duration 1 because that duration has the largest of the three durations.

BUT, if record 2, let's say, had a duration 3 of 60, then the sort order would change to:  2, 3, 1

 

Is that correct?  If so, what I am stating is that you want to sort by the max duration of duration 1, 2, and 3.

 

Please validate so I give you the right solution.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

Yes that is correct.

I've attached another example to better explain the scenario

 

Filter_gallery.PNG

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,988)