In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Multi-condition If Statement with a range as a condition

angeline559
6 - Meteoroid

I have a multi-condition IF formula that needs help.  I have a data set that needs to return a label for multiple conditions.  My formula is not working when one of the conditions is a range.  I would appreciate any advice on how I can improve the formula

 

Examples:

If the data is between 5 and 10, then "5-10"

If the data is between 11 and 14, then "10-14", Else ">14"

 

I have tried -, AND, as well as && to define the ranges without success.

 

Data of 5 or 11, will return the labels, but nothing else in the defined ranges

 

I would appreciate any advice on how I can improve the formula

5 REPLIES 5
Felipe_Ribeir0
16 - Nebula

Hi @angeline559 

 

One way of doing this, check the attached workflow

 

Felipe_Ribeir0_1-1666637196763.png

 

 

 

ChrisTX
16 - Nebula
16 - Nebula

Alteryx doesn't have a Between operator

 

try:

 

IF [my field] >= 5 and [my field] <= 10 THEN "5-10"

ELSEIF [my field] >= 11 and [my field] <= 14 THEN "10-14"

ELSE "> 14"
ENDIF

 

Chris

MilindG
12 - Quasar

MilindG_0-1666637446185.png

See if this works

 

angeline559
6 - Meteoroid

Thank you, @Felipe_Ribeir0 and @ChrisTX   Seems obvious now that I can see it.  Appreciate your assistance.

Felipe_Ribeir0
16 - Nebula

Hi @angeline559 

 

I am glad it worked. If you could mark the answers that helped you as a solution, i would be even more glad :).

Labels
Top Solution Authors