DMN Feel multiple Not Equals (!=)

1k Views Asked by At

I am reaching out to inquire about a challenge with DMN FEEL Logical Operator not equals.

Basically we are not getting a correct result when placing multiple Not Equals (!=) in a single field. From the attached example, we basically placed a condition in the 3rd column where if the Input.CallPurpose.Code is not equals to 2 or 1 - !="2", !="1" - then it should hit that row and return the output, but if we pass "2" or "1" then it should skip this row and try to hit the following rows accordingly.

In our case, If we pass (2) It hits the first operator (!= 2) and will skip the row which is the expected result; however if we pass (1) it will not compare to the second (!=) and it will not skip the row which is the incorrect result

If we pass a single != it works

Any help at this point would be much appreciated

Thanks

enter image description here

2

There are 2 best solutions below

1
On

For future reference, this was solved by using the below syntax:

!=["option 1", "option 2", "option 3"]
0
On

Possibly the most idiomatic way to do this, is to do something like:

not("B", "A")

So you want that if you supply either "A" or "B" it would match the first row. Example supplying C: example1

In this case matches the first row because C is not A, not B.

Example supplying A: example2

In this case A is matched in the first row using basic unary tests.

If you wanted a generalized extended unary test you could write

not( ? in ["A", "B"])

too.