5

I'm new on QGIS, I have shapefile for the whole country and also have for Province down to City/Municipalities, is there any way on attribute table where I can filter using an expression for example:

"PROVNAME" = 'CEBU', but this only for one area.

I tried adding multiple areas, like "PROVNAME" = 'CEBU' 'others' 'others'.

So basically tried that multiples areas, but getting an error:

Parser Error:
syntax error, unexpected STRING, expecting $end

Eval Error:
No root node! Parsing failed? 

Is there anyway I can select multiple areas by expression, so I can extract from a large area shapefile, I'm trying to filter it from country down to province and cities, so I can extract it easily.

2 Answers 2

7

From what I understand, what you are looking for is:

"PROVNAME" IN ('CEBU', 'others', 'others')

This will work, but it might not be the best solution if you are trying to select a large number of areas.

1
  • Very cool, I did not know you could make an expression like this. I learned something new today!
    – ed.hank
    Feb 27, 2016 at 17:20
3

You need to use the OR operator. Your expression would be

"PROVNAME" = 'CEBU' OR "PROVNAME = 'ABRA' OR "PROVNAME" = 'Whatever' 

Without that OR you will get a parsing error ( I tested my string expression without the OR and got the exact same error msg as you )

enter image description here

** Obviously our field names are different, but you want to format your expression like above

0

Your Answer

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

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