AnsweredAssumed Answered

How do I select the LAST of any number of duplicate records?

Question asked by Heather.Dean@CalOES.ca.gov_CalEMA on May 23, 2018
Latest reply on May 25, 2018 by jborgion

I have a table with parcel numbers in one field and soil types in another. There are several soil types for each parcel, and therefore several records for each parcel. 

 

I am looking for a script (Python, SQL, VB, Arcade) that will iterate through each record grouped by APN, selecting (or outputting) the LAST record for each APN.

 

Example input table:

APNSOIL TYPE
1A
2A
2A, B
3A
3A, E
3A, E, G

 

Desired result:

APNSOIL TYPE
1A
2A, B
3A, E, G

 

It's a simple task that seems like it should be easy, but I can't seem to find a solution. I've been working in Excel, ModelBuilder inside of ArcGIS Pro, and Python in Jupyter Notebook, but I'm not very well versed in any one program or language; maybe there's a better route of attack.

 

Thank you for any suggestions you might be able to provide!

Outcomes