Free Trial

Alteryx Designer Desktop Discussions

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

Getting the start date of a week based on the date in row

Deano478
12 - Quasar

Hi folks,

 

This might be something that may not be possible in Alteryx as I've tried various approaches and had no luck but here i goes:

 

I have data like so in which the  category or code will never change:

 

NameCategory CodeDate Inputted
Dean TestLeaveOT08/02/2023
Dean TestLeaveOT22/09/2022
Dean TestLeaveOT24/02/2023
Mark TestLeaveOT13/10/2022
Mark TestLeaveOT21/09/2022
Mark TestLeaveOT21/05/2023

 

And what im trying to achieve is a dynamic way to get get the first of the week for the date Inputted

2 REPLIES 2
binuacs
21 - Polaris

@Deano478 what is the expected output?

JamesC
6 - Meteoroid

Assuming you'd like the Monday to be the start of the week, this formula should work:

 

DateTimeAdd([Date],-ToNumber(DateTimeFormat([Date], '%u'))+1,"day")

 

This converts the current Date field to 1-7 (Mon-Sun), then uses that to get back to Monday

 

MondayOfWeek.png

Labels
Top Solution Authors