Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
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

 

 

binuacs
21 - Polaris

@joffner another method 

image.png

joffner
5 - Atom

Thank you :)

Labels
Top Solution Authors