Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

First and Last Day of Previous Week

briankuhlmann
8 - Asteroid

I am trying to use date formulas to feed a Dynamic Input. I need one formula that would grab the first day (Sunday) of the previous week. Then a second that would produce the last day (Saturday) of that week. I've fooled around with a few options and can't get what I need. Anyone have any suggestions?

 

For extra clarity, an example. If I was running the workflow today (10/27/21), I'd want the formulas to produce 10/17/21 as start of previous week and 10/23/21 as end.

 

Thanks

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @briankuhlmann 

 

Here is how you can do it. You can create [date] using datetimetoday() and follow below.

Workflow:

atcodedog05_0-1635348775573.png

 

Hope this helps : )

 

chukleswk
11 - Bolide

you would use a formula to determine what day number today is and then do a datetimeadd formula to get to the upcoming Sunday and then do a datetimeadd to get to the Sunday for 2 weeks ago to get the day you want as the start. You would do the same thing to get the Saturday. Please see the attached screenshots and flow and let me know if this gets you the results you were looking for.

first_last_day.PNG

first_last_day2.PNG

DavidP
17 - Castor
17 - Castor

Hi @briankuhlmann 

 

Something like this?

 

DavidP_0-1635352870366.png

 

briankuhlmann
8 - Asteroid

Thanks to everyone for your input. I was able to take a few suggestions and put a spin on them to get this. 

 

startendweek.jpg

This worked for me! Thanks for sharing.

Labels