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.

View solution in original post

@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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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