Filtering data

We can filter datasets in QGIS based on criteria we choose. This allows us to work with a logically defined subset of a layer or table.

Example of filtering spatial data - first image contains a detailed road network; second image shows only major streets

• Right-click the streets layer and choose Properties.

Streets layer → Properties

• From the Source tab, click the Query builder button at the bottom right.

Source → Query builder

Build the query: • Double-click Roadclass in the Fields window. The field name will appear, in quotes, in the expression box below.

<img src=’/qgis-mapping-spatial-analysis-intro/assets/images/query-builder-1.png’ alt=”“Roadclass” in expression box” width=’100%’ height=’100%’ />

• Click the NOT button, then the LIKE button.

<img src=’/qgis-mapping-spatial-analysis-intro/assets/images/query-builder-2.png’ alt=”Expression box with text: “RoadClass” NOT LIKE” width=’100%’ height=’100%’ />

• Click the All button under the Values window. This will display every unique value found within the Roadclass field.

Click all button under the Values window

• Double-click Local to create the complete expression: “Roadclass” NOT LIKE ‘Local’. Click OK.

<img src=’/qgis-mapping-spatial-analysis-intro/assets/images/query-builder-4.png’ alt=”Complete expression: “Roadclass” NOT LIKE ‘Local’” width=’100%’ height=’100%’ />

• Click OK to exit the Properties window. Result: local roads are now hidden from the display.

Filtered roads dataset in the map canvas


First created: May 25, 2026
Last updated: October 09, 2026

Tutorial maintained by Cole White.

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International icon