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.

• Right-click the streets layer and choose Properties.

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

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.

• 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.
