13  Filtering Data in QGIS

13.1 Working out what we have available to filter by

To work out what you want to filter by, it might be helpful to look at the attribute table for your layer.

Right click on the layer in the ‘layers’ panel and choose ‘open attribute table’.

This will show you the full dataset within QGIS.

However, while you can build a filter from within here, it’s not the easiest way.

13.2 Building a filter

Right click on the layer you are interested in in the ‘layers’ panel and choose ‘Filter’

This will bring up a ‘Query Builder’ page

To see what values exist for a column, click the column name in the ‘Fields’ list, then choose ‘All’ to see every category.

You can then build your filter clause

Double click on the column name in the ‘Fields’ to add that

Then choose an operator

Then choose a value from the ‘Values’ box by double clicking on it

You can click ‘test’ to see how many rows will remain in your dataset once the filter has been applied

When you’re happy, click ‘OK’ and the dataset will be filtered.

13.3 Spotting filters

You can tell if a layer has been filtered by the icon at the end of its name in the filter panel.

13.4 Clearing the filter

To remove the filter, open up the Filter options again (by right clicking on the layer in the layers panel and choosing ‘Filter’), choose ‘Clear’, then ‘OK’.