I've read (and had to deal with) values being changed to "NULL" when joining data from a table to a shapefile. Now I'm having an even more basic problem: for some tables, when I add the table, one of the number/integer columns fills with "Null". Here's what I've done so far:

  • My csv file has three columns, one is the County FIPS Code and the other two contain some numeric demographic information (average age and average income).
  • I created a .csvt file that states: "String","Integer","Integer"
  • Both files are saved in the same directory.
  • I've tried adding the table as a vector file (no geometry), as well as a text delimited file. In both cases, the second integer column fills with "Null".
  • I've closed an re-opened QGIS several times between each attempt.

Any suggestions for what I can try next?

Image of attribute table here.enter image description here

Image of original data table in Excel: enter image description here

  • can you share data to reproduce the issue? or at least screenshots of the attribute tables? – underdark Mar 28 '16 at 20:29
  • @underdark I just added an image, not sure if my firewall let it go through though. – N. Doole Mar 28 '16 at 20:42
  • It is not converting all the values to NULL - I see some values in the screen shot. Do those "Null" values actually have data or are they blank? If there is no associated data then the program is doing it's job. – Stella Mar 28 '16 at 20:48
  • Please also show the original input layers – underdark Mar 28 '16 at 20:48
  • 1
    Remove the commas – Stella Mar 28 '16 at 20:58

Do not start a new question, but please do accept this official answer:

The numbers in your original document are formatted with commas. Remove the commas since they are causing the Null values. This is a common issue when transferring table data into GIS. It has happened to me before... on multiple occasions.

As for the erroneous NULLs that remain, be sure to double check that they are formatted correctly - no spaces! Can you share your table?

| improve this answer | |
  • pointing out the formatting issue was very helpful. I then went back into the .csv file, removed all commas and checked for extra punctuation. I was still seeing some Nulls which I guessed was due to the FIPS codes being converted to "Number" in Excel whenever I opened the table in Excel. So in Excel, I set all the FIPS cells as "Text" and then in the csvt, I replaced the very last "Integer" with "Real" so when the table was imported into QGIS, it would recognize the decimals. So in the end, my csvt line was: "String"(3),"String"(15),"Integer","Real" – N. Doole Mar 29 '16 at 17:23
  • Glad you were able o resolve this @N.Doole – Stella Mar 29 '16 at 18:29

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.