-1

I am aware that this questions has been asked but I haven't really seen a satisfactory answer. I have loaded a CSV file into QGIS.

Picture of CSV table

It has been imported properly, with the first column as a string and the second as an integer.

However, when I join it to a shapefile - with a common field the name of the city/shire - the total field comes in with null values.

Joined attribute table

  • 1
    Please upload readable screenshots. – underdark Jul 21 '16 at 15:52
  • I had to strain my eyes to see it, but one field has a suffix ' city' or ' shire', the other doesn't. That's why your fields don't match up, that's why you get NULLs. It's almost always a bad idea to try to join on something like a name. Are there any other proper unique ids you can use? – Steven Kay Jul 21 '16 at 22:16
1

Create a unique ID field in the first column of the CSV file and populate it with a sequence (1,2,3...). Then load the CSV and join it to the shapefile.

I've had Qgis display null values in the attribute table until I included an ID column to the data.

  • Thanks for the answer. I tried that and it didn't work. I know that the csv fields are correct as the numbers are showing "int" and the text "string". – Phillip Money Jul 20 '16 at 21:09

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.