The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
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.

need help with datetimetoday formula

joffner
5 - Atom

wanting to mirror my excel formula if(date<(TODAY()-395), "No","Yes") .  Attempted  this formula but receive a red squiggle before the first DateTime. IIf DateTimeToday([Cal/Mth/Yr])<DateTimeToday()[Cal/Mth/Yr]-395 then "No" else "Yes" ENDIF

 

Cal/Mth/Yr - 2022-03-01

3 REPLIES 3
SPetrie
13 - Pulsar

DateTimeToday doesnt use arguments, its just todays date.

To get a year prior, you use datetimeadd but give it a negative number in units of years.

Assuming you have a column named date and it is a date format, you can use a formula like this.

IIF([Date] < DateTimeAdd(DateTimeToday(),-1,"years"),"Yes","no")

or 

If [Date] < DateTimeAdd(DateTimeToday(),-1,"years") then "Yes" else "no" endif

 

Youre example was combining both formats which will also give you headaches. 

Date.PNG

 

 

binu_acs
21 - Polaris

@joffner another method 

image.png

joffner
5 - Atom

Thank you :)

Labels
Top Solution Authors