Querying by Attributes

This tutorial covers selecting (or querying) features in a dataset based on their attribute values.

Included in this tutorial:

  • Accessing Select Features by Value

  • Selecting by qualitative values 

  • Selecting by quantitative values

  • Selecting by multiple parameters in the same field 

Software version in examples: QGIS-LTR 3.40.5-Bratislava

Tutorial Data: The tutorial includes demonstration with sample data available here.

Credits: Sally Kaye and L. Meisterlin (2025)

The options for selecting features for qualitative and quantitative attributes are demonstrated with examples.

 

Accessing Select Features by Value

In the Layers Panel, select the name of the layer from which to make selections. Access the Select Features by Value dialogue box by clicking the icon in the Selection Toolbar. 

The dialogue box displays all fields in the selected dataset. You can scroll up and down to view all fields in the box.

accessing the Select Features by Value dialogue box

Tip: You can find the same dialogue box by clicking the funnel icon in the Selection Toolbar in the Attribute Table to Select/filter features using form

By default, all fields in the attribute table are “excluded” from a selection to begin. (In other words, none of the layer’s attributes are currently used to select features.)

You may notice that the options available as selection criteria vary based on the data type of each field in the layer’s attribute table. Qualitative and quantitative fields present different options. The sections below include examples of each type. 


Selecting by qualitative values

The selection criteria options for qualitative attributes are predictably relevant to string or text fields. These include querying based on the specific sequence of text included in the values, such as matching a value (“equal to”) or querying for values that “start with” or “end with” certain text. You will also notice that qualitative (text/string) fields also have the additional “Case Sensitive” criterion option, which is not applicable to numeric data.

The example below demonstrates selecting all features from the layer called Points1_Table1_Join with values of “A” in the “Type_AB” field; in other words, Type_AB = A.

Click the dropdown menu currently labeled Exclude Field next to the field you would like to select features from (in our example, Type_AB). To pick all features where Type_AB is equal to a given value, choose Equal to (=) from the menu. In the text box next to the selected field, type the relevant attribute value for the selection; in our case, “A”. For demonstration purposes, we are not concerned with the Case Sensitive option.

To complete the selection, click Select Features. Selected features will appear highlighted in both the map canvas and attribute table. A bar at the top of the map canvas will display how many total features have been selected.

Click Close to close the dialogue box and return to the map canvas. 

making a selection with qualitative values


Selecting by quantitative values 

The selection criteria options for quantitative attributes are those more relevant to numeric data fields. These include querying based on relative value–for example, selecting values greater than or less than a threshold value.

The example below demonstrates selecting features where, both, values in the “Int_lrg” field are less than 100 (lnt_lrg) and values in the “Int_sm” field are not equal to 5 (Int_sm ≠ 5).

Click the Exclude Field dropdown menu next to the Int_lrg field and select Less than (<). In the corresponding text box, type “100.”

Repeat, selecting Not equal to () next to the Int_sm field and typing “5” into the text box.

You can create parameters from as many fields as you would like before choosing Select Features to select all features that fit the selection criteria.

making a selection with multiple quantitative criteria


Selecting by multiple parameters in the same field (“or”)

The quantitative example above demonstrated a compound query where two criteria from different fields are satisfied. In this example, we will demonstrate selecting features that satisfy either of two criteria from the same field. Specifically, we will select features with either a value of A or a value of B in the Type_AB field. (This will ultimately select all features in the sample dataset.)

Select all features where Type_AB = A as described above under Selecting by qualitative values.

Then, return to the text box next to the Type_AB field, delete A and replace the value with B.

Click the dropdown arrow next to Select Features at the bottom of the dialogue box and select Add to Current Selection. This will keep the selected features from the previous selection and add the new selection (in our example, all features are selected, because all features have a Type_AB value of either A or B).

Click Close to close the dialogue box and return to the map canvas. 

adding to selection

 
Previous
Previous

Interactive Selections & Other Selection Basics

Next
Next

Batch Processing (almost) any tool in ArcGIS Pro