I am working in Qgis. I have a vector layer called Kimball Building with about 5,000 records in it. I have multiple fields including one called PermitType. Most of the values in this field are NULL. Some records have another value in the PermitType field. I would like to delete all of the records that have NULL in the PermitType field. I am thinking this could be done in Python, but not sure where to begin. I can delete items individually, but deleting 4,000 records one at a time is not a practical solution.

  • why not sort the permit type field ascending, all the nulls should be on top, highlight all of them and hit delete... i think that should do it
    – ed.hank
    Dec 30 '15 at 17:59

There is a simple way to do it without using Python.

  1. Make the Kimball Building layer editable (click the toggle editing button on the toolbar)
  2. Open the attribute table
  3. Click on the 'Select features using an expression' enter image description here button.
  4. Enter an expression to select desired records, i.e. "PermitType" IS NULLenter image description here
  5. Press 'Select', close the expression editor, then click on the delete records button in the attribute table.
  6. End your editing session and save the edits.
  • 1
    @RobUsakowski would you mind accepting the answer by clicking on the green tick if this worked for you? cheers.
    – yanes
    Dec 30 '15 at 20:32

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.