2

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

asked Mar 28, 2016 at 20:26
8
  • can you share data to reproduce the issue? or at least screenshots of the attribute tables? Commented Mar 28, 2016 at 20:29
  • @underdark I just added an image, not sure if my firewall let it go through though. Commented Mar 28, 2016 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. Commented Mar 28, 2016 at 20:48
  • Please also show the original input layers Commented Mar 28, 2016 at 20:48
  • 1
    Remove the commas Commented Mar 28, 2016 at 20:58

1 Answer 1

2

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?

answered Mar 28, 2016 at 21:50
2
  • 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" Commented Mar 29, 2016 at 17:23
  • Glad you were able o resolve this @N.Doole Commented Mar 29, 2016 at 18:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.