Alteryx Designer Desktop Discussions

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

Regarding AND Operator

ashiques
8 - Asteroid
Hi ,

I have a file in which I have to add a new field "Index2" . So I used the Formula tool and wrote  "IF [Index] == '5' and [Index] == '5.1' THEN 1 ELSE null() ENDIF"   But it gives only null values. I want to check both values and not one. Hence, I use "and". When, I use Boolean operators- or ,OR , || , it gives values for  [Index] == '5' only. So, how do I get the value 1 if  both conditions are true? If both condition are not satisfied then the output should be "null".
 
IndexNameValue
5F30
5F40
5F50
5F60
5F70
5F80
5F90
5F100
5.1F3933491
5.1F4618520
5.1F51033364
5.1F6937850
5.1F71777408
5.1F8561006
5.1F9847674
5.1F10954346
3 REPLIES 3
Ned
Alteryx Alumni (Retired)
You are looking for the OR operator.  The AND operator is true if both sides are true.  The OR operator is true if either side is true, which is what you are looking for.
ashiques
8 - Asteroid
I want to check both Condition for true if its true then 1 else 0 . AND Operator didnt work here it gives only null values.
amyralene
5 - Atom
Have you tried using IN?

IF [INDEX] IN ("5","5.1") THEN "1" ELSE  NULL() ENDIF
Labels