Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam posts. As we work toward a permanent solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts. Thank you for your patience!

Alteryx Designer Desktop Discussions

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

Week number and year to Date

KS
6 - Meteoroid

Hello, 

 

I need you help please, I have two columns, one with the year and one with the week number, Sunday 1st January being week 1.

I want to return the Friday date for each row but for week 1, I want it to return the Sunday.

Example : for week 28 of year 2023, the date should be 07/07/2023 / week 1 of year 2023, the day should be 01/01/2023/ week 2 of year 2023, the date should be 01/06/2023. 

 

I got it in excel but don't know how to put it in Alteryx.

Attached is the sample to use to get the date. 

 

I hope you can help me.  

 

Thank you in advance

11 REPLIES 11
caltang
17 - Castor
17 - Castor

You can filter for Week 1 using the Filter Tool and get the result in TRUE, whereas other weeks are under FALSE. 

 

From there, you can use the following formula for Fridays:

DateTimeAdd([Start],5-ToNumber(DateTimeFormat([Start],"%w")),"days")

 

Replace it for Sunday as such:

DateTimeAdd([Start],7-ToNumber(DateTimeFormat([Start],"%w")),"days")

 

Hope this helps!

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
FrederikE
13 - Pulsar

Hey @KS,

 

 

See the attached WF, this should help.

KS
6 - Meteoroid

Hi @caltang

 

Thank you for your feedback. Can you please clarify what [Start] in this case is ? 

 

I have the answer but in excel as you can see attached. the Date column is the one I need in my output. 

 

Thank you.

caltang
17 - Castor
17 - Castor

[Start] represents your Dates. I've attached my workflow for your review. Hope it helps!

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

Hi @KS 

 

Sorry, I read your statement wrongly. Fixed it with my new export, please find attached.

 

Thanks,

Cal

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
KS
6 - Meteoroid

Hi @caltang

 

Thank you. Actually the Date column does not exist the input file. I just added it to show the output that I need. 

 

I can only use the Week and year columns. 

 

Thanks, 

KS

caltang
17 - Castor
17 - Castor

You should have mentioned that earlier…! 

Kindly attach your sample without the excel dates, just the raw data you want to transform. 

Kindly edit your main post and attach your file there as well.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
KS
6 - Meteoroid

My bad, I though it was clear. I only included the date column to show the output I needed. 

 

I just edited my post. 

 

Thanks, 

KS

caltang
17 - Castor
17 - Castor

Fixed. That should be it! :) 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels