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.

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
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
Top Solution Authors