2

I am looking to extract all features that have a field with values above 0 from a shapefile, then export the selected features. I can do an advanced expression such as:

'Field' Not Like '0'

which will leave me with the features I want. However, then, I have to go into the attribute table and highlight these values, then right click on the layer -> Save as -> Save selected Feature.

Is there a way to save the features all in one run?

1
  • "'Field' Not Like '0'" is a curious selection statement. Since the literal 'Field' is never like the literal '0', the expression is akin to 1 = 1. And without a wildcard in the like pattern, this would be much slower than the equivalent not equals (<>).
    – Vince
    May 8, 2023 at 10:29

1 Answer 1

8

Use the QGIS Extract by expression algorithm with the following expression:

 "Field" > 0

Replace Field with your field name, set where to save the results and then run the algorithm.

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.