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.
SOLVED

Malformed If Statement

CRogers22
8 - Asteroid

I'm trying to create an IF statement to tell me if there is >= 3 days between dates. Can someone tell me what I'm doing wrong?


if [Application Date]-[Disclosure Date]>=3 then 'Pass' else 'Fail'

4 REPLIES 4
binu_acs
21 - Polaris

@CRogers22 

IIF DateTimeDiff([Disclosure Date], [Application Date],'Days') >= 3, 'Pass','Fail')
CRogers22
8 - Asteroid

Thank you. Now I'm getting Unknown variable "IIF"

binu_acs
21 - Polaris

put a bracket after IIF

updated the formula

IIF(DateTimeDiff([Disclosure Date], [Application Date],'Days') >= 3, 'Pass','Fail')

 

LindonB
11 - Bolide

Hi there. First, just add a select tool first to make sure both fields are numeric. If so, your expression is fine but needs "ENDIF" at the end. It won't work otherwise. 

 

if [Application Date]-[Disclosure Date]>=3 then 'Pass' else 'Fail' endif

Labels
Top Solution Authors