Is there an OOTB geoprocessing tool that can be used to select the greatest 1 per group in a FGDB table?
For example, for a given ASSET_ID, select the road inspection that has the latest date.
Related:
I know you mentioned you're using a fGDB but if you were using an enterprise gdb (egdb), then you could use SQL to do this.
There's an article here that explains the syntax to use - <date> = (SELECT MAX(date) FROM <table_name> GROUP BY <group_ID>)
The article does say if you create an OLE DB connection to a MS Access table then you could use the SQL syntax above.
Looking for a fGDB solution right now.
UPDATE: It seems with Python you can do this - here's a link here that shows a labeling example. I'm not a Python person but I suspect many on this forum are.
UPDATE 2: For fGDB data, use the Dissolve GP tool with the Maximum value set for the Statistics Field Parameter. That should work for you BUT it does create a new FC unfortunately.
Thanks!
FYI - The SQL syntax in that article appears to be incorrect: Select maximum values in Select By Attributes (greatest n per group)
Also, for my notes, the Dissolve tool doesn't seem to work for standalone tables. But the Summary Statistics tool does.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.