Alteryx Designer Desktop Discussions

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

Previous Week Start and End

Mario36
8 - Asteroid

Hi,

 

I managed to get the start and end date of the current week, the formula is built based on today's date. What I am looking for is to fetch the start and end dates of the previous week and it should start from monday and end on friday.

 

Example:

Today = 2021-07-12

Start of Prev Week = 2021-07-05

End of Prev Week = 2021-07-09

 

In addition to the above, would it be possible to get the start and end dates of a week based on the number of week of the year. Say if the number is 28, my results should be as below.

Start of week : 2021-07-12

End of week : 2021-07-16

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @Mario36 

 

Solution based on your first ask. I took your workflow minus 7 day from current day to get last weeks start and end.

 

atcodedog05_0-1626100159780.png

 

Hope this helps : )

 

Working on the second ask.

 

Mario36
8 - Asteroid

@atcodedog05  Awesome, this works. Let me know once you get a breakthrough on the second ask.

atcodedog05
22 - Nova
22 - Nova

Hi @Mario36 

 

Solution on 2nd ask.

 

Workflow:

atcodedog05_0-1626100808266.png

1. Calculated first of year from datetimenow

2. Added N*7 days to it (n weeks, weeks is directly not supported)

3. Using your formula calculated first and last day of week.

 

Hope this helps : )

Mario36
8 - Asteroid

@atcodedog05  Thank You. This is an amazing breakthrough.

Mario36_0-1626281975629.jpeg

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Mario36 

atcodedog05
22 - Nova
22 - Nova

You are awesome too 😎 @Mario36  you already had done the heavy lifting in this usecase.

Mario36
8 - Asteroid

Thanks Mate
Cheers !

Labels