Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

DATE help

FredrikMB
5 - Atom

Hi

 

I have a table containing year and day number for the given year. I need to create a date using those two inputs. That is easy in Excel, but have not been able to do it in Alteryx.

 

Anyone that can help me out?

 

 2019-01-22_13-26-28.png

 

Best Regards

Fredrik

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

Hi @FredrikMB

 

What about the month?

 

Cheers,

FredrikMB
5 - Atom

Hi

 

Thanks for the quick response :)

 

Unfortunately the table does not contain the month. That is the reason I am struggling with this.

 

Fredrik 

BenMoss
ACE Emeritus
ACE Emeritus

This is actually quite simple using the datetimeadd function; something like...

 

[Year]+"-01-01"

 

Will give the base date for the year and then...

 

DATETIMEADD([Year]+"-01-01",[day],'days')

 

Will add the number of days in your day column to this base date.

 

If your [Year] field is numeric then you must wrap it in tostring, like...

 

DATETIMEADD(tostring([Year])+"-01-01",[day],'days')

 

Ben

Thableaus
17 - Castor
17 - Castor

@FredrikMB

So is the day number absolute? Like it can go up to 365 in a year?

FredrikMB
5 - Atom

Thanks for the help. This worked really well :)

 

Best Regards

Fredrik

Labels
Top Solution Authors