2

I am joining a .csv file to shp layer and it goes well except all the values from the .csv file disappear (there's NULL in the attribute after the join)?

I don't have X & Y coordinates, but I'm combining it with a place name.

For example, shp files contains text columns (example made in excel on purpose):

enter image description here

And the .csv file contains also additional info

enter image description here

I also tried to add these columns straight into the shp layer attribute table to fill in the info there from the csv file by hand, but I couldn't fill in any information. There's also NULL (in both form view and table view options), but I can't edit the cell at all. I can only edit the cells that already existed in the shp file itself.

What could be wrong with this as well, should I enable editing separately for these new columns?

enter image description here

I'm quite a beginner with QGIS, but this is really something I just can't figure out.

5
  • 3
    Welcome to GIS.SE. I guess you're using join attribute by field value?
    – Erik
    Nov 11, 2019 at 9:15
  • 3
    please show us examples of the actual file - most likely issue is mismatch in case of join fields
    – Ian Turton
    Nov 11, 2019 at 9:20
  • 4
    The join is obviously not working ... Are u sure there is no difference in the countries naming in your two sources ?
    – Snaileater
    Nov 11, 2019 at 9:20
  • @Erik Thank you! I am not quite sure whether it was that one, possibly? I opened properties from the shapefile layer and chose ''Joins''. There I chose ''Join layer'' to be the csv spreadsheet and join & target fields to be the ones they needed to be (matching column names for both, for example if shp layer had the countries below ''Country'' and csv spreadsheed below ''Name'') Should the columns actually be named the same? I thought it was ok as long as the rows beneath the columns have same styling, for example first letter being capital?
    – Jazz
    Nov 12, 2019 at 8:57
  • @snaileater I will look into this! Like an answer below pointed out there might be empty space left.
    – Jazz
    Nov 12, 2019 at 9:02

1 Answer 1

1

I had a similar problem in the past, and the cause was blank space(s) before and after the values in my join fields. They're hard to spot! For example 'France' will not join to 'France '. So do a search/delete for blank(s) in both the shp and csv join fields and retry the join.

1
  • Thanks for bringing this up, I have to check!
    – Jazz
    Nov 12, 2019 at 9:03

Your Answer

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

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