cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vffdd
Super User
Super User

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
WarrenBelz
Super User
Super User

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
WarrenBelz
Super User
Super User

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.

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

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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