community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Date Month Week 1

Meteoroid

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!!

Alteryx
Alteryx

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

Meteoroid

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!!

Highlighted
Nebula
Nebula

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

Meteoroid
 
Labels