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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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