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

Delegation warning showing for from and to date filter in Gallery

How to remove delegation warning in this date filter or how to make this code in efficient way

  If(
        Checkbox1_1.Value = true,
        Filter(
            '[T5097_DHR_WASHER_TXN]',
            C901_TXN_STATUS = 0,
            DateAdd(
                C5097_INITIATE_DATE,
                TimeZoneOffset(),
                Minutes
            ) >= StartDate_1.SelectedDate,
            DateAdd(
                C5097_INITIATE_DATE,
                TimeZoneOffset(),
                Minutes
            ) <= EndDate_1.SelectedDate
        ),
        Filter(
            '[T5097_DHR_WASHER_TXN]',
            DateAdd(
                C5097_INITIATE_DATE,
                TimeZoneOffset(),
                Minutes
            ) >= StartDate_1.SelectedDate,
            DateAdd(
                C5097_INITIATE_DATE,
                TimeZoneOffset(),
                Minutes
            ) <= EndDate_1.SelectedDate
        )
    )

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

@SumanKoduri ,

I can give you some condensed code, but date queries are simply not Delegable.

Filter(
   '[T5097_DHR_WASHER_TXN]',
   If(
      Checkbox1_1.Value = true, 
      C901_TXN_STATUS = 0,
      true
   ) &&
   DateAdd(
      C5097_INITIATE_DATE,
      TimeZoneOffset(),
      Minutes
   ) >= StartDate_1.SelectedDate &&
   DateAdd(
      C5097_INITIATE_DATE,
      TimeZoneOffset(),
      Minutes
   ) <= EndDate_1.SelectedDate
)

If your data set is under 2000 items or the data you need is in the newest 2000 items or you can filter to under 2000 items with a text or numeric field, you could do this with a collection.

 

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

15 REPLIES 15
WarrenBelz
Super User
Super User

@SumanKoduri ,

I can give you some condensed code, but date queries are simply not Delegable.

Filter(
   '[T5097_DHR_WASHER_TXN]',
   If(
      Checkbox1_1.Value = true, 
      C901_TXN_STATUS = 0,
      true
   ) &&
   DateAdd(
      C5097_INITIATE_DATE,
      TimeZoneOffset(),
      Minutes
   ) >= StartDate_1.SelectedDate &&
   DateAdd(
      C5097_INITIATE_DATE,
      TimeZoneOffset(),
      Minutes
   ) <= EndDate_1.SelectedDate
)

If your data set is under 2000 items or the data you need is in the newest 2000 items or you can filter to under 2000 items with a text or numeric field, you could do this with a collection.

 

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.

@SumanKoduri ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

 

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.

dyee4614
Helper V
Helper V

For sharepoint, I make two copies of the date.  The first is the actual date and the second is the actual date in number format.  For example, for the date I'll store it as just a simple now() function.  The second step is to save a second version of the date in number format.  For 6/9/2020, I like to convert it to 20200609.  

 

You can delegate numbers so with this work around you can filter by the date.  If you need help, I can pull up an old app for a concrete example. 

Thanks @dyee4614 ,

I posted a solution in that direction recently - I may head that way depending on @SumanKoduri 's needs.

Hi @SumanKoduri ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

 

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.

Hi @SumanKoduri ,

I am following up this post to see if it can be closed if you obtained the result you were looking for.

Please click Accept as solution if my post helped you solve your issue as 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.

Thanks for your reply, I'm doing testing in this filter.
I've some doubts in this let me get back to you

even if I give today's date after inserting in dB it is taking yesterday date, why is it happening

Hi @SumanKoduri ,

I assume you are referring to the timezone issue? 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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