One of the main issues that users seem to need a bit of help with in ArcGIS Desktop is the whole Joins and Relates ‘thing’. I guess this comes up a lot in the petroleum sector as users are often trying to Join pick data to wells, or Relate production data to fields, etc. As such we thought it would be useful if the next in our series of GIS Tips walks through the process of how to set-up Joins and Relates.
Joining Attribute Tables
A join is a means of appending a spatial layer and a data table (or two separate data tables) together based on a common attribute or field. Joins work best when the tables/layers have a ‘one-to-one’ relationship (i.e. a single row in the external table corresponds to a single spatial feature). This is useful when you would like to label or symbolise your spatial layer using data held in an external table, or export a layer with rich attribution. For an example see the schematic above (taken from the ArcGIS Desktop help):
To Join a layer to an external data table follow the simple steps below:
- Open the context menu of the layer that is receiving the join, by right clicking on the layer name.
- Select Joins and Relates then select Join…
- Choose the field in the original table to base the join on.
- Choose the table to join to this layer.
- Choose the field in the second table to base the join on.
- Choose to keep all records or only the ones that match the joined table.
- Click OK.
- Open the context menu of the layer, and select Open Attribute Table. All field names will now be prefixed with name of the original table to show the join.
Relating Attribute Tables
Table relates associate data tables without permanently appending them to the base dataset like in a Join. Relates are designed when the relationship between the spatial layer and the external table is ‘one-to-many’ (i.e. there are many rows in the external table corresponding to each spatial feature). To Relate a layer to an external data table follow the simple steps below:
Open the context menu of the layer that is receiving the relate, by right clicking on the layer name.
- Select Joins and Relates then select Relate…
- Choose the field to base the relate on.
- Choose the table to relate to this layer.
- Choose the field to relate this table to the original layer.
- Type a name for the relate.
- Click OK.
- Open the attribute table, click on Options, select Related Tables, and select the relate.
Posted by Chris Jepps, Technical Director, Exprodat.