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

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
13 - Pulsar

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
21 - Polaris
21 - Polaris

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

0713-Saravanan13.PNG

 

Labels
Top Solution Authors