Alteryx Designer Desktop Discussions

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

OR formula under IF statement not reading all values

StutiG612
6 - Meteoroid

Hi,

 

I am trying to get the following output in Alteryx using  multiple IF and or statements (this is a hypothetical example similar to my problem):

 

NamesNumbersPass/Fail
A0.1211Pass
A0.1219Pass
A0.1215Pass
B0.1217Pass
B0.1211Pass
B0.1223Pass
C0.1223Pass
C0.1211Pass
D0.1227Fail
E0.1218Fail
F0.1213Fail
G0.1216Fail

 

Here's the formula I am using:

IF [Names]="A" or [Names]="B" or [Names]="C" THEN IF [Numbers]=0.1211 or [Numbers]=0.1223 or [Numbers]=0.1215 or [Numbers]=0.1217 or [Numbers]=0.1219 THEN "Pass" ELSE "Fail" ENDIF ELSE "Pass" ENDIF

 

But in the output, some of the above values meant for Pass condition are failing, while some are passing. This is what i am getting:

NamesNumbersPass/Fail
A0.1211Pass
A0.1219Fail
A0.1215Pass
B0.1217Pass
B0.1211Pass
B0.1223Fail
C0.1223Fail
C0.1211Pass
D0.1227Fail
E0.1218Fail
F0.1213Fail
G0.1216Fail

 

Can someone help me understand why it might be happening?

5 REPLIES 5
Felipe_Ribeir0
16 - Nebula

Wrong answer, will try again

Felipe_Ribeir0
16 - Nebula

Hi @StutiG612 

 

I got a little confused trying to get what you need, but this formula is returning the right result (at least for this small sample of your dataset):

if [Names] in ("A", "B", "C") OR [Numbers] IN (0.1223, 0,1215, 0.1217, 0.1219) 
THEN 'Pass' 
else 'Fail' 
endif

Screenshot 2023-08-29 100721.png

PhilipMannering
16 - Nebula
16 - Nebula

Your highlighted Fails should be Passes according to your formula. It might help to use a Select Tool and change [Numbers] to a fixed decimal with size 19.4.

PhilipMannering
16 - Nebula
16 - Nebula

Hi @StutiG612. Did @Felipe_Ribeir0's solution work for you? Can you mark as solved if so?

KamenRider
10 - Fireball

HI @StutiG612 

 

Here's my solution:

 

sOL1.PNG

regards,

Kamen

Labels