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):
Names | Numbers | Pass/Fail |
A | 0.1211 | Pass |
A | 0.1219 | Pass |
A | 0.1215 | Pass |
B | 0.1217 | Pass |
B | 0.1211 | Pass |
B | 0.1223 | Pass |
C | 0.1223 | Pass |
C | 0.1211 | Pass |
D | 0.1227 | Fail |
E | 0.1218 | Fail |
F | 0.1213 | Fail |
G | 0.1216 | Fail |
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:
Names | Numbers | Pass/Fail |
A | 0.1211 | Pass |
A | 0.1219 | Fail |
A | 0.1215 | Pass |
B | 0.1217 | Pass |
B | 0.1211 | Pass |
B | 0.1223 | Fail |
C | 0.1223 | Fail |
C | 0.1211 | Pass |
D | 0.1227 | Fail |
E | 0.1218 | Fail |
F | 0.1213 | Fail |
G | 0.1216 | Fail |
Can someone help me understand why it might be happening?
Wrong answer, will try again
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
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.
Hi @StutiG612. Did @Felipe_Ribeir0's solution work for you? Can you mark as solved if so?