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