Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
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