Selecting items with optional field

Working on report that is selecting items with optional field value CS using ICILOC, ICITEM, ICITEMO tables. I tried several formulas including  if{ICITEMO.OPTFIELD}<>"CASE" then "1" else "0" or if{ICITEMO.OPTFIELD}="CASE" then "1" else "0" and they all display correct values. When I try to use select expert and select “1” or “0” formula stops working and all items are selected. Any tips?