Alteryx Designer Desktop Discussions

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

Convert month year to first day of month

Saravanan13
8 - Asteroid

Hello,

 

I am looking to convert the below field in to 1st day of the month example : 10/01/2021

 

Input

10-2021 (mm-yyyy)

 

Output

10/01/2021

 

can anyone assist.

 

 

2 REPLIES 2
SPetrie
12 - Quasar

You could use a formula to parse it to a date/time data type and then use a datetimeformat on it to put it into the desired output

 

datetimeformat(DateTimeParse([date],"%m-%Y"),"%m/%d/%Y")

 

Or, since it looks to mainly be in the format you want anyway, you can replace the dash with /01/ and it would also look like what you want.

replace([date],"-","/01/")

 

1.PNG

Qiu
20 - Arcturus
20 - Arcturus

@Saravanan13 
We can also use the DateTimeTrim function, which is my favorite. 😁

0713-Saravanan13.PNG

 

Labels