This is not working

SetNull several values at a time

I've got this error: Error!

I've tried several combinations:

SetNull("rocksoilver12"==10 OR "rocksoilver12"==14, "rocksoilver12")

SetNull("rocksoilver12"==10 or "rocksoilver12"==14, "rocksoilver12")

SetNull("rocksoilver12"==10 OR "rocksoilver12"==14, "rocksoilver12")

SetNull("rocksoilver12" IN (10,14), "rocksoilver12")

SetNull("rocksoilver12" IN [10,14], "rocksoilver12")

SetNull("rocksoilver12" in [10,14], "rocksoilver12")

This is the error message that I've got: enter image description here

None of them worked :/

Now, this works fine:

SetNull("rocksoilver12"==10, "rocksoilver12")

How can I use SetNull to delete multiple cell values at a time?

  • Have you tried a lower case 'in', that should be valid python syntax. I'm pretty sure operators are case sensitive in the same way functions are.
    – RoperMaps
    Jun 24 '17 at 19:54
  • 1
    OR is not going to work, see help which button is it perhaps |
    – FelixIP
    Jun 24 '17 at 21:00
  • @RopeyMaps, in [xxxx] or in (xxxx) didn't work either. See the screen shot added with the error message I've got. This shouldn't be that difficult!
    – Delonix R.
    Jun 25 '17 at 1:47
  • No, it shouldn't! You could scrap the python and use the where clause as optional third argument. That's sql so capital IN. I only have arc at work so can't check till I'm there.
    – RoperMaps
    Jun 25 '17 at 9:45
  • Question: so the box inside RasterCalculator where SetNull, Con, and all the operations are typed, that should be in Python syntax or in SQL syntax? Thanks.
    – Delonix R.
    Jun 26 '17 at 16:03

Use the boolean OR operator "|" .

SetNull("rocksoilver12"==10 | "rocksoilver12"==14, "rocksoilver12")

Or the InList function:

SetNull(InList("rocksoilver12", [10, 14]), "rocksoilver12")
  • @Delonix I have updated my answer.
    – user2856
    Dec 20 '17 at 20:42

Try this :

SetNull(("rocksoilver12"==10) | ("rocksoilver12"==14), "rocksoilver12")

I had a similar problem, putting those extra brackets helped me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.