I have a field in a shapefile with values ranging from 1-50 and multiple listed as 0. Is there a way to label only the features where the number in the priority field is > 0?
You can put this as the label expression for the feature:
def FindLabel([yourField]): if [yourField] is not None: if int([yourField]) > 0: return [yourField] else: return None else: return None
Using Python as the parser and checking the Advanced box.
Replace [yourField] with whatever field you are using to label.
I deal with this from time to time. You should use the Expression button in the Label tab. There you use the Advanced parser (checkbox), and write something like this (Python):
def FindLabel ( [Name], [V5] ): if [V5] == "0": return "<BOL>"+ [Name]+"</BOL>" else: return "<BOL>"+ [Name]+"</BOL>" + "\n" +"<FNT size = '6'>"+ str([V5] )+"</FNT>"
This will return labels for each feature from field
Name in bold, and in smaller print the value from
V5for those that are > 0 (assuming non-negative values).
In Layer Properties - Labels- Method click the drop down to select Define Classes, then use the SQL Query to limit the label to only those features.
Alternately you could use a selection query for those features, save the selection as a new layer in your TOC using the create features option, and then label those features.