Filter on records for this week

I am trying to set page variable which will be used as filter in a repeating group. I have several filter buttons; one for ‘Today’, another for ‘This Week’ and ‘All’. Today is easy to do as set hours to 23 and min to 59 nut I am stuck on how to set end date for Fri mightnight.

I realise you can extract day from current date/time but how do i set this to day 5 at 23 hours and 59 min?

Hey @eric.schwantler.

Hopefully somebody will reply with a more elegant solution, but this is what I ended up with a while back:

I have a reusable element I call that sets a custom state of start date and end date based on whatever is needed (this month, last month, this week, last week, quarter/year, etc.)

Note that in my case, I am setting the value knowing that I will be using it where I only have access to greater than and less than (not greater than or equal to.) So for the end date/time of Saturday, I actually set to Sunday at 00:00:00 and for start date, I go to Saturday at 23:59:59.

This Week looks like this:

36%20AM

It’s involved, but I just couldn’t wrap my head around anything simpler!

thx @mebeingken i see how you solved the problem but very involved. If we have a function to set the date variable to day number it would be easy. @emmanuel ?

Then I would use
current day/time +days:7 set day:0 set hour:00 set min:00 which would make variable next Sun morning which would be satisfactory as end date to signify end of business week

This topic was automatically closed after 70 days. New replies are no longer allowed.