cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
janineb
Helper II
Helper II

Help with Filter and SUM function in PowerApps

Good day

 

I have a SQL table called "ZHA_IND", with a column name called "GSART".  Under column GSART I have records that contain "33L", "33A","33B","33I","33K","33D" and "33C") which I want to filter on.  After filtering, I want to SUM all the extracted items under the "EXPOSURE" column).  I have a variable declared for the record called varBPRecord.  This is my formula (but I know it is totally wrong and it also gives me a Delegation error):

 

Sum(Filter(ZHA_IND,varBPRecord.GSART="33L",varBPRecord.GSART="33A",varBPRecord.GSART="33B", varBPRecord.GSART="33I",varBPRecord.GSART="33K",varBPRecord.GSART="33D",varBPRecord.GSART="33C"),ThisItem.EXPOSURE)

 

Can you please assist me with the correct formula?  I am just totally braindead this morning 

 

Thank you kindly

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @janineb ,

I am not an SQL user, but this structure should work and solve your Delegation issue providing the top filter returns record numbers less than your Delegation limit

With(
   (
      wList:
      Filter(
         ZHA_IND,
         varBPRecord.GSART="33L" ||
         varBPRecord.GSART="33A" ||
         varBPRecord.GSART="33B" || 
         varBPRecord.GSART="33I" ||
         varBPRecord.GSART="33K" ||
         varBPRecord.GSART="33D" ||
         varBPRecord.GSART="33C"
      )
   },
   Sum(
      wList,
      EXPOSURE
   )
)

 

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.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @janineb ,

I am not an SQL user, but this structure should work and solve your Delegation issue providing the top filter returns record numbers less than your Delegation limit

With(
   (
      wList:
      Filter(
         ZHA_IND,
         varBPRecord.GSART="33L" ||
         varBPRecord.GSART="33A" ||
         varBPRecord.GSART="33B" || 
         varBPRecord.GSART="33I" ||
         varBPRecord.GSART="33K" ||
         varBPRecord.GSART="33D" ||
         varBPRecord.GSART="33C"
      )
   },
   Sum(
      wList,
      EXPOSURE
   )
)

 

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.

Visit my blog Practical Power Apps

Thank you - as always you have solved my problem.  Much appreciated

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 (2,516)