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

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels