1

I have a water tank data(.shp) and I need to label it using field NAME. However I just want to label water tank that have names like "Tangki Air Sembulan". If in the field NAME only states "Tangki Air", I do not want the label to appear. Im using Arcgis 10.2 and label using Maplex. I try to use SQL Query like below:

NAM NOT Like '%Tangki Air%'  
AND NAM NOT Like '%TANGKI AIR%' 

but it's not working. I cannot edit the field name so is there a way that can help me solve this problem?

2

1 Answer 1

2

I think I know what you're after. The query to label features that have a NAM that starts with "Tangki Air" but not the generic name "Tangki Air":

NOT UPPER("NAM") = 'TANGKI AIR'

if you have multiple values to supress:

UPPER("NAM") NOT IN ('TANGKI AIR','OTHER VALUE')

Using the UPPER function means you can do comparisons on just the text; note that shapefiles and personal geodatabases are not case sensitive but file geodatabases and SDE data is case sensitive.

So, putting this all together to label Tangki Air features, but not the generic Tangki Air:

UPPER("NAM") LIKE 'TANGKI AIR %' AND NOT UPPER("NAM") = 'TANGKI AIR'
2
  • hi Michael...you are absolutely right..sorry for the unclear question and poor English. thank you for helping me solving this problem..
    – user
    Aug 5, 2014 at 4:05
  • You're welcome, it did take me a while to understand what you were asking but I got there in the end. If you are happy with that can you please accept the answer to show future users that this helped. Aug 5, 2014 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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