0

I have a Hydrant layer and a hydrant inspection table. So when I join them, it is a one to many join since there are multiple inspections for one hydrant.

I need to populate a field in the hydrant layer with the inspection data. However, I only want to populate the hydrant layer with the most recent inspection for a given hydrant.

How do I do this?

I'm hoping for a Python or arcade script to run. I just don't know where to start.

I've thrown around doing a summary table first... but it's just too many steps for me to feel comfortable handing that off to a client, so I'd rather have a script for them to run.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Katie B.
  • 807
  • 1
  • 7
  • 18
  • 2
    you could filter (use definition query) on your inspection table to only show the latest inspection record for each hydrant, and then join to the hydrant layer. What have you tried? Please [edit] your question to include any Field calculator or arcpy attempts that show where you're stuck. A sample of your two tables would be useful also so we know what fields you've got to work with. – Midavalo Jan 27 '21 at 17:47
  • There are hundreds of inspection records with multiple inspections for each unique hydrant ID. Correct me if I'm wrong, but there isn't a definition query to show only the most recent inspection record for each unique Hydrant ID. Other than using a custom python or arcade script, which is what I'd need help with. – Katie B. Jan 27 '21 at 17:57
  • 1
    What is your table stored in? It might be possible to do a MAX or similar query. Please [edit] your question to include more info about your data, and to show what you've already actually tried. Questions asking for help with code (field calculator or arcpy) should show your code attempt – Midavalo Jan 27 '21 at 17:59
  • Populate new field in inspection table using https://gis.stackexchange.com/questions/375316/ranking-polygons-within-feature-class-by-group-and-by-area-in-arcmap/375397#375397 you need records where new value =1 – FelixIP Jan 27 '21 at 18:51

0 Answers0