4

I have a point layer representing sites where data was collected. The data was edited and stored in an Excel spreadsheet (CSV). I needed the data to be joined to the sample sites. I followed the steps mentioned here: Joining data from Excel to attribute table in QGIS without creating duplicates? And it worked. However, when I attempted to load the same layer in a different project, the data from the spreadsheet was not there. It seems that the joined data was not permanently added to the attribute table of the shapefile. Is it possible to make these additions from the spreadsheet permanent to the shapefile?

Layer properties of the points layer that has the joined fields

2
  • 2
    Create new columns for the shapefile which contain the joined data. Or repeat the join. – Erik May 5 at 12:08
  • 2
    It's joined on load. You would need to repeat the join in the new project. Did you try exporting the layer? I don't know if that works. – wingnut May 5 at 12:15
6

The join is only permanent within the project you did the join in; basically the attributes are just linked and the link information is stored in the project file (.qgs or .qgz). If you want to hardcode the joined attributes in a layer, you need to export the joined layer as a new file via right clicking on that layer and choosing export -> save features as. Note that if you do so and change data in your excel file, the hardcoded attributes in the join-layer do not get updated any longer, they will keep their values they had when you saved the file.

Alternatively you can also run Join attributes by field value from processing toolbox which automatically generates a new layer (be careful: the output is temporary by default. You will loose it when closing QGIS. So you also need to save this one to your harddisk)


Keep Shapefile limitations in mind! Fieldnames can have a maximum length of only 10 characters. I suggest to use another file format like Geopackage for example. If you are required to save it as Shapefile, you need to rename the fieldnames. To do this you can run refactor fields from processing toolbox, give the fields a new name with max. 10 characters and save the output of this tool as Shapefile.

3
  • 1
    When saving feature as the field names changed to Sam_#. and then using "Join attributes by field value" the fields were added but none of the values, so I had an empty table. – Greg.Crichton May 5 at 13:47
  • 1
    typical shapefile issue: fieldnames can be max. 10 characters long. I suggest to use another file format like geopackage. If that is not an option for you, run refactor fields tool before saving as shapefile and rename the fields so they have max. 10 characters. – MrXsquared May 5 at 13:51
  • 1
    Thank you for your help, all sorted now. – Greg.Crichton May 5 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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