2

I am trying to join a .csv file to a layer in QGIS 2.18.6. For that I created a .csvt file. However, I am not able to join the two files. I tried it with the key both as integer and string but in both cases it didn't work. When the key is an integer I have the additional problem, that the leading zero disappears in the key column which makes it obviously impossible to link it to the shapefile.

The .csvt file looks as follows:

"String","Integer","Integer"

or

"Integer","Integer","Integer"

The .csv file contains in the first column the key and in the rest data. The .shp file only contains a key column in the attribute table.

3

Worked fine for me using either:

"String","Integer","Integer"

Or no csvt at all:

enter image description here

enter image description here

| improve this answer | |
  • 1
    I need the csvt file for a classification afterwards. However, it is working for me as well now. I don't know exactly where my error was. Thanks for your help! – Hannah H. Apr 13 '17 at 12:02
  • @Hannah, the best way to say thanks is accepting the answer (as it seems that this solution solved the issue). – mgri Apr 13 '17 at 12:17
1

since it worked for me as well, maybe the problem is not within qgis, but your workflow? did you do the following:

  1. load both files in qgis
  2. open properties of Prognoseraum.shp
  3. go to tab Joins and click the green plus symbol
  4. select the join field
  5. press OK press Apply press OK?
| improve this answer | |
  • I tried a reboot (classic) and afterwards it was working for me as well. Maybe some problems with the updates. Thanks for your help – Hannah H. Apr 13 '17 at 12:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.