I brought in a vector shapefile with around a total of 20 different pressures. I want to make this vector into two different shapefiles. One for the property "Pressure" of lines that have under 20 pressure and another for the same property that has a pressure of 20 and over. I know of the Vector > Split Vector Layer command but that splits the one shapefile into 20 different ones.

2 Answers 2


I would probably do the following:

  1. Use the Field Calculator to create a new field and then use an expression like:

    if( "Pressure" < 20, 0, 1 )

    This will add a '0' to all features with a pressure value less than 20, otherwise will it will add a '1'.

  1. Run the Vector > Data Management Tools > Split Vector Layer tool and select the new field to produce two shapefiles.
  • Wouldn't I need to define what Pressure is? As in say [if ( attribute = Pressure < 20, 0, 1 )]
    – Shub
    Jun 15, 2017 at 20:24
  • @Jhunt9 - No, in the field calculator you can just type the name of the field directly into the expression. Normally, field names are inside double quotes as in my post but no need to use attribute = Pressure, just "Pressure" is enough :)
    – Joseph
    Jun 16, 2017 at 9:07

Select all the lines with a pressure < 20 and then save it to a new file making sure to check save only selected features. enter image description here

Then invert the selection (look in the selection expression menu) and then save again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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