Question re: Label Manager in ArcMap 10.4
Trying to create a label class using the "Not" function in SQL Query to exclude certain values, and can't seem to make it work.
Here's an example -
I have, say, 200 different PLANT types, 1 thru 200. I want to create a label class that includes all but the fifteen PLANT types 35, 57, 62, 83, 86 .... So in the SQL Query I enter: "PLANT" NOT '35' ... etc.
Yes, I know there are ways to approach it other than using the "Not" function. But I'd like to do it using the "Not" function if there's a simple way to do that.
Does the "Not" function not work in creating label classes in this way? Or is there a trick to it that I'm not seeing?
Solved! Go to Solution.
I think the proper syntax would be FIELDNAME NOT IN (VALUE 1, VALUE 2)
I think the proper syntax would be FIELDNAME NOT IN (VALUE 1, VALUE 2)
Thank you Kyle, but I haven’t been able to make that work, either.
In the Layer Properties box I have “Label features in this layer” checked. Next to “Method” I’ve selected “Define classes of features and label each class differently.”
I have two Label Classes. One is the default class, whose "Label features in this class" I have confirmed by checking and unchecking. The second is the EXCLUDE15 class, whose "Label features in this class" I have checked.
In the EXCLUDE15 class I've tried "PLANT" NOT IN '35' and "PLANT" NOT = '35' just to see if I could exclude labeling for that one value. With either of those, none of the 200 values are labeled.
If the value is a string, you could try <FieldName> IS NOT <VALUE>
If the value is integer, you could try FieldName <> Value
Wait, I got it to work. Not sure if it mattered, but previously, I was entering the parentheses from the keyboard instead of using the () button in the SQL Query window.
This worked: "PLANT" NOT IN ('35','19')
Thanks for your help.