We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Last day of the previous month

sebenciven
8 - Asteroid

Hi,

 

I have these date and I would to obtain the last day of the previous month.

For example: If I have 2024-09-30 -> I would obtain 2024-08-31

 

I can't use the DateTimeFirstOfMonth(), -1, 'month' because the original date can change in every time.

 

Thanks to all!

3 REPLIES 3
binuacs
21 - Polaris
davidskaife
14 - Magnetar

Hi @sebenciven 

 

Try this

DateTimeAdd(datetimetrim([Date],"FirstOfMonth"),-1,"day")
OTrieger
14 - Magnetar

@sebenciven 
DateTimeTrim is the function that you are looking for.
DateTimeTrim([Date],"firstofmonth") first day of the month

DateTimeTrim([Date],"lastofmonth") last day of the month

Labels
Top Solution Authors