Alteryx Designer Desktop Discussions

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

Formula

Lkschwe
7 - Meteor

I am trying to write a formula to list "Y" if Last Login date is <= 90 days from today's (current date) - see below:

 

IIF([Last Login])<=90"days"([2021-030-18]"Y","N")

 

What am I doing wrong?

2 REPLIES 2
CarliE
Alteryx Alumni (Retired)

Hi youll want to use the datediff fuction 

 

if DateTimeDiff(DateTimeToday(),[date2],'days')<=90 then 'Y' else 'N' endif

Carli
Luke_C
17 - Castor

Hi @Lkschwe 

 

Try this. I'm using the 'datetimediff' function to determine the number of days between today and the last login date. This assumes your last login field's data type is set as a date. Hope this helps. 

 

IIF(datetimediff(datetimetoday(),[Last Login],'days')<=90 , "Y" , "N" )

 

Labels