7

I have a shapefile and a csv file that I want to join. The csv file has:

  1. MSA identifiers
  2. County identifiers within MSA (so, across MSAs the county_id is not unique)
  3. a series of attributes (each column with zeros and ones) that I want to add to the shapefile.

The shapefile has the MSA identifier and the county identifier (again, unique within MSA, not across MSAs).

How can I join the shapefile and csv file, when the join operation has to be based on two attributes of the shapefile and csv file? Both "Add vector join" and "Attributes join from csv" (mmQGIS) seem to allow for joins with a single attribute as identifier.

1
  • could you create a virtual field combining the two?
    – Ian Turton
    Commented Oct 18, 2016 at 14:48

1 Answer 1

7

QGIS 2.16+ allows you to add virtual fields to your data set, so you could create one containing the two columns concatenated together (use the || operator) and then make your join using that column.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.