2

I have a .csv file that contains instances of hospitalization with diagnosis codes and zip codes and I want to join it to the corresponding polygons in the TIGER 2017 zcta510 shapefile. Every time I attempt to do this by selecting the Joins button in Layer Properties...then +...Join layer is my .csv import...join field is Zip...Target field is GEOID10.

Anyway, it seems to be only importing the initial instance when each zip code should have multiple instances. I am trying to use the symbology tools to create a shaded view of where patients are coming from.

I have a feeling that I'm missing something simple...but I've over-thought it now.

2

Based on @csk suggestion and what you mentioned in the post it seems like you are doing a one-to-many join (one zip code-to-many records of hospitalizations). Since vector files are organized in such a manner that one record/row represents one feature (zip code boundary in your instance), when you are doing a join you will only get a record of the first instance that is in this zip code. You have two options to join the datasets:

  1. Do one-to-many table relationship if you need to preserve info about each hospitalization - but then you wouldn't be able to do a choropleth (Joining multiple records to single feature using QGIS?)
  2. Summarize the attributes when joining the tables. Easiest way would probably be to do a pivot table in excel and get the table formatted so that each row is a zip code and columns are summary of instances of hospitalization (i.e. zip code 11000 had 210 hospitalizations in month X). If the hospitalizations have coordinate info beyond the zip code (i.e. GPS coordinates), you can map out the points of hospitalizations and then do a spatial join, with option of summarizing attributes/counts of input points.
  • Also, I may post back here again if I have other questions regarding this specific instance...if that's okay? – urbaneezer Jun 7 '18 at 20:31
  • If it's within the scope of your original question - sure. Otherwise close the question (mark as answered) once you are done. – Ruslan Jun 7 '18 at 20:33

Your Answer

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

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