In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Malformed IF Statement with day ranges

llewellyn
5 - Atom

Hi I am trying to create an output column that says either "1-30" or "31-60" or "61-90" based on what another column says.  

I've tried 2 different ways...the 1st way: I get false "1-30" range displayed when it should be displaying "31-60" range instead. 2nd way: I get Malformed IF Statement error (I've tried changing every data type and nothing works).

 

1st way: this gives me false range outputs.

IF [DAYS_PAST_DUE]<="30" THEN "1-30"
ELSEIF [DAYS_PAST_DUE]<="60" THEN "31-60"
ELSEIF [DAYS_PAST_DUE]<="90" THEN "61-90"
ELSEIF [DAYS_PAST_DUE]<="120" THEN "91-120" Else "Current" ENDIF

 

2nd way: Malformed IF Statement

if [DAYS_PAST_DUE]>="1" AND if [DAYS_PAST_DUE]<="30" then "1-30"
elseif [DAYS_PAST_DUE]>="31" AND if [DAYS_PAST_DUE]<="60" then "31-60"
elseif [DAYS_PAST_DUE]>="61" AND if [DAYS_PAST_DUE]<="90" then "61-90"
elseif [DAYS_PAST_DUE]>="91" AND if [DAYS_PAST_DUE]<="120" then "91-120"
elseif [DAYS_PAST_DUE]>="121" then "Delinquent"
else "Current" ENDIF

1 REPLY 1
Qiu
21 - Polaris
21 - Polaris

@llewellyn   

 

  • Dont quote the numeric field
  • And if is not necessary, only and

1215-llewellyn.PNG

Labels
Top Solution Authors