Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RÉSOLU

How to convert string Month and Year to Dates

Ro2
Météore

Hi, I'm just trying to combine two string columns together into one date column.

For example:

First column called "Month" is a string column with MAR

Second column called "Year" is also a string with 2024

6 RÉPONSES 6
alexnajm
17 - Castor
17 - Castor

What is your end expected result? For example if you want a Date data type in this case, what would be the day if you were to put these together?

 

Otherwise, you can just use a Formula to do [Month]+" "+[Year]

Ro2
Météore

I want the output to be Date. That formula does not work for a date output. The day can be 01

Ro2
Météore

I want the output to be Date. That formula does not work for a date output. The day can be 01

alexnajm
17 - Castor
17 - Castor

Correct, it would not because there wasn't a specification about the day - that's why I asked the question!

 

Here is a workflow that would work:

 

DateTimeParse(ToString([Year])+[Month],"%Y%b")

Ro2
Météore

That works great! Thanks so much for your time.

alexnajm
17 - Castor
17 - Castor

Happy to help!

Étiquettes