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.

Why is this formula not working as intended? Datetime

terrellchong
8 - Asteroid

terrellchong_0-1641282944153.png

You can see that from Output

Temp is 2020-01-05

and I am expecting the datetimefirstofmonth will return 2020-01-01

but it returned 2022 instead

 

is there any misunderstanding of the formulas?

 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @terrellchong 

 

DateTimeFirstOfMonth() Is designed to give only first of current month. To get first of given month use formula like below

 

DateTimeFormat([Temp],"%Y-%m-01")

 

Workflow:

atcodedog05_0-1641283290693.png

 

Hope this helps : )

atcodedog05
22 - Nova
22 - Nova

Hi @terrellchong 

 

You can also use

 

DateTimeTrim([Temp],"firstofmonth")

 

Hope this helps : )

terrellchong
8 - Asteroid

so it basically ignores the year? 

atcodedog05
22 - Nova
22 - Nova

Hi @terrellchong 

 

No lets say current month is Feb even though Temp might be 2020-01-05 it will return 2022-02-01. DateTimeFirstOfMonth() will always return first day of current month Similar to DateTimeToday()

 

Hope this helps : )

Labels
Top Solution Authors