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– underdark2016年03月28日 20:29:12 +00:00Commented Mar 28, 2016 at 20:29
-
@underdark I just added an image, not sure if my firewall let it go through though.N. Doole– N. Doole2016年03月28日 20:42:42 +00:00Commented 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.Stella– Stella2016年03月28日 20:48:08 +00:00Commented Mar 28, 2016 at 20:48
-
Please also show the original input layersunderdark– underdark2016年03月28日 20:48:09 +00:00Commented Mar 28, 2016 at 20:48
-
1Remove the commasStella– Stella2016年03月28日 20:58:13 +00:00Commented Mar 28, 2016 at 20:58
1 Answer 1
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?
-
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– N. Doole2016年03月29日 17:23:32 +00:00Commented Mar 29, 2016 at 17:23
-
Glad you were able o resolve this @N.DooleStella– Stella2016年03月29日 18:29:37 +00:00Commented Mar 29, 2016 at 18:29