'QGIS Join data from CSV to ESG file appearing NULL
Working in QGIS 3.4.17 for Mac
I need to transfer one column of data from an attribute table (imported CSV file) to another attribute table (ESG shapefile).
In the past I have always used a join to import the data. On this occasion, once I’ve made the join, the column just appears blank (all fields are NULL). I’ve tried numerous ideas on Stack Exchange.
My join data is ‘Address ID’. In the CSV file this is Integer, however for the ESG file it is Integer64. To work around, in the ESG file I created another column ‘Address ID2’ making sure it is Integer, thus being identical to ‘Address ID’ in the CSV file. Regardless, the join still isn’t working, and the imported data is NULL.
Is there anything else I can do? I’m not familiar with the Field Calculator or code, so please provide step-by-step information if you have any ideas. There are over 5000 entries, so I can’t write them all out again.
Solution 1:[1]
In most of the cases when you load a CSV file all fields are read as text. So i think that you can load the CSV file to the project, calculate a new field in the CSV file converting the original values to int.
Put this in field calculator:
to_int(csvfieldnamehere)
Then you can use the join fields by attribute tool.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
