I just started to work with QGIS recently and am struggling with the following:
I have 1 a CSV table on offshore branches of certain institutions including info on their respective countries of origin. No geographical data except the columns with country names (
Here is an example of the table with the relevant columns:
|Institution name||Institution Branch||Home Country||Host Country|
- I also have 2 a polygon layer with the world countries in which each country takes 1 row, and each with it's own polygon represented in the shapefile (the country name column is named
Both attribute tables use the same format for the country names.
Now I would like to
- add a field (column) to the 2 country layer's attribute table that counts for each country how many institutions have it as a
Home Countryin the CSV table. Using the above table as an example, the new column would count 2 for Germany, and 1 for USA.
- add additional columns to the 2 country layer's attribute table that count for each country how many institutions have it as a
Home Countryin the CSV table AND have a branch in a certain
Host Country. For example in the above table I would like to only count for those countries with institutions with a branch in
Host Country= India. The resulting column should count 1 for Germany, and 1 for USA.