In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Year of previous month

MRPP
6 - Meteoroid

Hi Community !

 

Need your help to figure out how to calculate 'Year of previous month'. I work on a report which is a 'snapshot' of previous month. While there's no issue with year (whether current month or previous) during Jan, I would be working on Dec data of 'last' year, so my formula needs to point to 2022 when I would be reporting on Jan'23 month.

 

something that must look like this: [Ddate Year] = ToNumber(DateTimeFormat(DateTimeToday()-30,"%Y"))

 

Thanks in advance !

3 REPLIES 3
ChrisTX
16 - Nebula
16 - Nebula

Try this formula:   DateTimeYear(DateTimeAdd([MyDate],-1,"months"))

 

ChrisTX_0-1660314260531.png

 

 

Chris

PhilipMannering
16 - Nebula
16 - Nebula

Hey @MRPP You want something like,

datetimeyear(datetimeadd(DateTimeToday(), -1, 'month'))
MRPP
6 - Meteoroid

This works !

Labels
Top Solution Authors