I have a layer with three columns:
- geoid: ID of each polygon (string)
- totpop: Total population of each polygon (integer)
- neigh6: Comma separated list of the IDs of polygons that neighbor that polygon (string)
So for example, instead of a column with these geoids: 49047940201, 49013940600, 49013940500
I want a column with population for each of those GEOIDs listed: 5039, 6893, 1094
I want to create a new field that has the population of the tract instead of the ID of that tract, eventually to sum up and identify the average population of the neighboring tracts.
I was trying to figure it out with the array_foreach() function, but got stuck. This doesn't work, (results in all null values), but I wasn't expecting it to since it doesn't account for the specific GEOID.
array_foreach(
string_to_array("neigh6", ','),
@element="TOTPOP")