Alteryx Designer Desktop Discussions

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

How to get the date last month

herbert1682
6 - Meteoroid

Hi I need to add the date for last month the month and the year I usually do a manual and type in the month (12) and year (2023). 

 

image.png

2 REPLIES 2
cjaneczko
13 - Pulsar

You can use these two formulas to get the Year and the Month for last year. You can combine the two into one formula box if you need to concatenate them in anyway. This is Dynamic, do if you are in February it should still return December of 2023 no matter which day you run the report this year. If you need it to only show you the prior month, you can remove this: "-DateTimeMonth(DateTimeNow())" and update it to "-1".

 

Year

 

Datetimeyear(DateTimeAdd(DateTimeNow(),-DateTimeMonth(DateTimeNow()),'month'))

 

 

 Month

 

Datetimemonth(DateTimeAdd(DateTimeNow(),-DateTimeMonth(DateTimeNow()),'month'))

 

 

herbert1682
6 - Meteoroid

Looking at Capture 3 this works! 

Labels