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

Not considering entire condition

Abhishekjoshua
7 - Meteor

When I click on RUN, it is just considering the 1st line of condition which is of "30" and ignoring the rest. I'm clueless as I'm new to Alteryx

 

Can someone help me here?

 

IF [Days Pending for - PT]>30 THEN ">30 Days"
ELSEIF [Days Pending for - PT]>19 THEN "20-30 Days"
ELSEIF [Days Pending for - PT]>9 THEN "10-20 Days"
ELSEIF [Days Pending for - PT]>5 THEN "6-10 Days"
ELSEIF [Days Pending for - PT]<6 THEN "0-5 Days"
ELSE "NA"
ENDIF

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @Abhishekjoshua 

 

Can you share some data? It seems to work fine for me:

Luke_C_0-1658325404512.png

 

 

IraWatt
17 - Castor
17 - Castor

Hey @Abhishekjoshua,

If statements apply the logic in the order you right them AKA they apply the first rule which works. I would write that statement like this:

 

 

IF [Days Pending for - PT]<6 THEN "0-5 Days"
ELSEIF [Days Pending for - PT]<11 THEN "6-10 Days"
ELSEIF [Days Pending for - PT]<21 THEN "10-20 Days"
ELSEIF [Days Pending for - PT]<31 THEN "20-30 Days"
ELSEIF [Days Pending for - PT]>30 THEN ">30 Days"
ELSE "NA"
ENDIF

 

 

IraWatt_0-1658325490658.png

The community has some quick and easy videos on formulas and the Formula Tool here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Writing%20... 

 

Any questions or issues please ask :)
HTH!
Ira

Labels
Top Solution Authors