Alteryx Designer Desktop Discussions

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

Date Month Week 1

lailas
7 - Meteor

Hi, I have a date in the format April Week 1

 

I need this to take in the current year and change to be the first day of the (in this case) first week of April of 2019.

 

How can I achieve this? TIA!!

4 REPLIES 4
LukeM
Moderator
Moderator

Hi @lailas,

 

Are you looking for the first day of april of this year - i.e. 2019-04-01? Or do you want the first complete week in that month? And is that week commencing Monday or Sunday?

 

Luke

lailas
7 - Meteor

Hey @lukem,

 

Thanks- I am looking for the Monday that the week begins on (regardless if it is full- for example, May's first week this year I would say started on April 29).

So for example: April Week 1 would be 4/1/2019 ; May Week 3 would be 5/13/2019 etc.

Currently, the field says April Week 1. 

 

Thank you!!

danilang
19 - Altair
19 - Altair

Hi @lailas 

 

WF.png

 

This workflow starts with a regex to parse the month and week number from the input.  The formula calculates the first of that month in the current year.  Next is a Generate Rows tool that creates a record for each of the days 6 days prior to the month start.  After finding the weekday, I select the Mondays.  The final step is to add the number of Weeks -1 to the Monday to reflect the start of the week in question.

 

Results

 

Results.png

 

Dan

lailas
7 - Meteor
 
Labels