English

FAQ: Why does the IN operator return NODATA for a False condition (value is not in list)

Question

Why does the IN operator return NODATA for a False condition (value is not in list)

Answer

With the IN operator, if the value is not in the list, then NoData is returned.

A previous bug with the IN operator allowed 0 to be incorrectly returned if a value was not in the list. This has been resolved at 8.0.1.

For example, consider a test to see if 1 is in the list {3,4,5}. In versions previous to 8.0.1, the condition evaluates as follows:

  "1 IN {3,4,5}" returns "0"

In versions 8.0.1 and above, the condition evaluates as:

  "1 IN {3,4,5}" returns "NODATA"

An alternative for users wishing to maintain a favored functionality is to enclose the IN function in brackets. For example:

  "(NOT ISNULL (1 IN {3,4,5}) )"  returns "0"