ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to get the date last month

herbert1682
Meteoroide

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 RESPOSTAS 2
cjaneczko
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
Meteoroide

Looking at Capture 3 this works! 

Rótulos
Autores com maior número de soluções