Start Free Trial

Alteryx Designer Desktop Discussions

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

How to use Less/greater than or equal to condition with dates

Saravanan13
8 - Asteroid

Hello,

 

I am looking to get the below output and condition is if datetimetoday is equal to date and if datetimetoday is greater than date then the status="add" else its should be as it is.Can anyone help. I am get numeric values for status if I use "If else" condition

 

Input

 

AccountDateStatusToday
A3/9/2024Need3/11/2024
B3/12/2024Need3/11/2024
C3/11/2024Need3/11/2024

 

Output

 

AccountDateStatusToday
A3/9/2024add3/11/2024
B3/12/2024Need3/11/2024
C3/11/2024add3/11/2024
2 REPLIES 2
cjaneczko
13 - Pulsar

If your fields are Date fields the following formula should work. You may be getting an error because the dates are not setup as Date Fields in Alteryx and could be Strings. 

 

 

 

if [Today] >= [Date] then 'add' else [Status] endif

 

 

If the Date fields are strings you can update them to Date with the following Formula.

 

DateTimeParse([Date],'%m/%d/%Y')

 

image.png

JosephSerpis
17 - Castor
17 - Castor

Hi @Saravanan13 you need to convert your date into a YYYY-MM-DD format to use greater or less than operations however you can do this all in a single formula.

 

Dates_If_11032024.png

Labels
Top Solution Authors