Table Joins
Table joins append information in one table to another based on matching shared values in a common field. This tutorial demonstrates two ways to perform a table join in QGIS.
Included in this tutorial:
Preparing a table join and checking field data types
Option 1: Initiating and executing a table join through layer properties. Exporting the results of a table join to a new feature class.
Option 2: Using the Join Attributes by Field Value tool
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)
In our demonstration example, we will join a table of values to the attribute table of a dataset of point features. We will demonstrate two different ways of joining or appending these fields.
Preparation
Add both the target layer and the join table to a project. The “target” is the layer or table that will receive the appended field(s). It is the layer you are “joining to.” The “join table” includes the fields that will be added to the target’s attributes.
In our example, we use Points1 as the target feature class and Table1 as the join table. (Both of these are included in the tutorial standard data package.)
Checking data types
To execute a table join, the relevant common fields in the target layer and joint table do not need to have they same name but must have the same data type (e.g. long integers or text).
To verify the data type of both join fields, right-click on the layer name in the Layers Panel and navigate through Properties > Fields to view the fields table.
In this example, ‘fid’ in the Points1 feature class is an integer type. ‘PointID’ in the join table is a text string.
verifying field data types within an attribute table
Creating a new field
If necessary (to ensure two fields of the same data type), we can create a new field with the desired data type in the attribute table, using the Field Calculator to copy the values from the original field to a new one of the appropriate data type. In this example, we need to create a new field with an integer data type and the same values as PointID. This is demonstrated below and described in more detail in Adding and Calculating Fields in an Attribute Table.
creating a new field to prepare for a table join
Option 1: Table Join in Layer Properties
This first approach creates a temporary join between the two tables within the current QGIS project. To do this, we initiate the join on the target layer.
Add New Join
Right-click on the target layer name (Points1, in this example) in the Layers Panel and click through Properties > Joins. Click the green + at the bottom of the Joins window to add a new join to this layer. This will open the Add Vector Join dialogue box.
Using the dropdown menus, choose the three primary parameters of a table join:
First specify the join layer (or table). In our example, we are joining Table 1 to the target layer.
Next, choose the join field. This is the field within the join layer’s table that serves as the basis for matching values in the target layer’s table. The dropdown menu will be automatically populated with the fields in the join layer’s table. In this example, the integer field we created called JoinID serves as our join field.
Finally, specify the target field. Like the previous parameter, this is the field in the target layer whose values will be compared to those in the join table; matching values will be joined. The dropdown menu will be automatically populated with fields from the target layer’s attributes. (We select the fid field below.)
TIP: Notice that the field names in the dropdown menus are listed along with an indicator for their data type. For example, “abc” indicates text values.
The dialogue box has options to edit the fields and properties of the join, as well as others that may be useful to explore. In the demonstration below, we customize the field name prefix with a blank input—by default, joined fields are assigned a prefix that is the name in the source (join) table.
Click OK to apply the join.
setting up and performing a table join
Examining the Results of a Table Join
To confirm the results of the join, check that information from the join table (Table1) is visible in the attribute table of the target layer (Points1), as expected.
confirming the results of a table join
Export joined data to a new feature class
To create a new vector dataset from a target layer that includes the fields from a joined table, you can export the resulting temporary join. To do so, right-click on the layer name in the layers panel and click through Exports > Save Features As.
Name your file and specify where to store it.
exporting the target layer with the joined data to a new feature class
Option 2: The Join Attributes by Field Value tool
Unlike adding a join from Layer Properties, the Join Attributes by Field Value tool presents the option to join and export a new joined vector dataset in one single step. It also includes a few different parameters that may be more useful in different circumstances than those available in Option 1 above.
Accessing and Running the Join Attributes by Field Value tool
You can access this tool in the Processing Toolbox under Vector General. As always, you can also find it with the Processing Toolbox’s search function.
Basic parameters
The nomenclature of this dialogue box is slightly different from the earlier approach but the relationships established in the join operation are the same. Here, the target layer is labeled the Input Layer, and the join layer or table is referred to as Input layer 2.
With this in mind, the tool’s parameters are very similar to creating a temporary join through the target layer’s properties.
Specify the Input layer as the target layer (the layer’s table which should receive the appended fields), and its Table field as the attribute field of values it shares with the join table (i.e., the values that serve as the basis of the join).
Specify the Input layer 2 and Table field 2 as the join layer/table and its relevant join field for matching values.
In our example demonstration below, we repeat the same layers and fields options from the Option 1 demonstration.
A few other options to note
The tool’s parameters include several other options to consider. For instance, you can choose which fields to copy from the join table if you only want or need to append specific fields to your target’s table. In our example, we append the full join table to the target by leaving this option blank.
You can also choose either a ‘one-to-one’ or ‘one-to-many’ join type. While a one-to-one join is the most common table join approach, it is useful to remember that the one-to-many option is available.
Like in the option to add a join from Layer Properties, you can customize a prefix for joined fields.
By default, the tool generates a temporary layer and opens (or adds) it to the current project. You can also choose to create a new dataset file by clicking the three-dot button to the right and specifying a name and location for saving the new file.
Executing the tool
Click Run to export the feature class with the added join.
accessing and running the Join Attributes by Field Value tool
Examining the Results
To confirm the results of the join, check that information from both the target layer and join table are visible in the new output layer created by the tool. The attribute tables of the input layers will not be changed.
confirming the results of the Join Attributes by Field Value tool