My problem with QGIS (version 3.4.8)

I have a .shp map layer containing point data of buildings. I want to join .csv spreadsheet to this layer so I can look into it and visualize different variables of this spreadsheet on the map. The join is done by building value, not coordinates. The spreadsheet contains variables that are from the same building. If I'd do the basic join, it would only combine one of these variables by the building value and leave others out.

Here's a picture with example data of what I mean:

Because Emloyees A, B, C and D have all the same building the basic join function only includes one of them. Let's say if the .csv spreadsheet has 500 fields, because of this it returns back 350 and 150 are left out because of the same building value.

Only column I need from the .shp attribute table is the Building value so I can look into the different variables from the .csv spreadsheet on the map.

enter image description here

I was advised in Getting duplicate values when joining .csv spreadsheet to .shp map layer using QGIS? to do join attribute by values for joining the .shp and .csv files. This joined table now includes all the values (the example 500 values) even with the same building value so exactly what I wanted.

Is it possible to join this joined table back to the .shp map layer containing the point data so that all points are visible even some of them in this case are on top of each other?

For the visualization it wouldn't show of course, but it would be crucial to know where and how many (N=?) points are located on the map. So is it possible to display all the 500 points on the map (for example where companies are located), even though 150 of them are from same buildings?

I tried to do this with the basic join (Layer properties of the .shp -> Joins) but it did the same as when I started, leaving variables out with the same building value and containing only the first observed value.

I also thought of adding the left out values all as separate .csv spreadsheets and looking into these separately, but that would take a lot of time.

  • From what I see you need to have a 1-M join where I building is joining to multiple rows in the spreadsheet. There are other neater ways to achieve this. The fist one being using relations in QGIS as explained here fulcrumapp.com/blog/using-relations-in-qgis or alternatively you could create the join using a virtual layer. Lastly you could do away with shapefile and csv by creating a geopackage and do the join inside using DBManager – kartoza-geek Jun 20 '19 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.