cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

apologies another FirstN query !

So I had a couple of FirstN queries earlier that were solved very quickly and I have one more !

 

I am trying to do a FirstN on a filtered list but instead it is FIltering the FIrstN list !     I've played around with it so again think I'm close but just not there.

 

Here's what I have

 

Filter(FirstN(Sort(MainList, QueriedAmount, Descending),Value (TopNumber.Text)),QueryStatus<>"Closed",QueryStatus<>"Resolved")

 

So that actually works except it Filters the FirstN instead of the list.. which makes sense because Filter is listed first.  So in otherwords it takes the Top 10 and then it filters that to give me the ones that aren't closed or resolved.  I want it to filter the main list for those that aren't closed or resolved and then do the FirstN on those !

 

I've tried moving where the Filter command is but just can't get it right !

 

Do I need to do the filter first put the result of that into a collection somewhere and then do the FirstN on that? or is there an easier way to do it?

 

TIA

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @vffdd ,

I would go this way

FirstN(
   Sort(
      Filter(
         MainList, 
         QueryStatus<>"Closed" && QueryStatus<>"Resolved"   
      ),
      QueriedAmount, 
      Descending
   ), 
   Value(TopNumber.Text)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hi @vffdd ,

I would go this way

FirstN(
   Sort(
      Filter(
         MainList, 
         QueryStatus<>"Closed" && QueryStatus<>"Resolved"   
      ),
      QueriedAmount, 
      Descending
   ), 
   Value(TopNumber.Text)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Super thanks @WarrenBelz  I  knew I was close just couldn't quite get it !! 🙂

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,904)