Alteryx Designer Desktop Discussions

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

Combing Month and Year in 1 Field

alyssa_sedai
8 - Asteroid

I have a Column Year (2015 for example) and a Month Column (1-12 for January through December) as well as a month2 Column which list out January, February, March, etc.  Is there a way to combine it so I can get 1/1/15 as a date field?

 

alyssa_sedai_0-1580834484319.png

 

alyssa_sedai_1-1580834519468.png

 

4 REPLIES 4
afv2688
16 - Nebula
16 - Nebula

Hello @alyssa_sedai,

 

Short answer, No. Date fields can only be in yyyy-mm-dd format, any other fomat would be a string.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

danilang
19 - Altair
19 - Altair

Hi @alyssa_sedai 

 

The longer answer is...you can create a string field, called Output, in the format you want using the following formula 

 

"1/"+tostring([Month])+"/"+Right(tostring([Year]),2)

 

You just can't use this in Alteryx to perform any data calculations or sort your values.  To do those, create a Date field with this

DatetimeParse([output],"%d/%m/%y")

 

You'll be able to use this to sort your records and perform DateTime math

 

Dan

 

alyssa_sedai
8 - Asteroid

Hello @afv2688,

 

So basically there is no way to combine these fields into a date?

 

 

 

alyssa_sedai
8 - Asteroid

Thank you @danilang 

Labels