Select to view content in your preferred language

select the 3 features that have the largest attribute value

1513
5
08-17-2020 06:12 AM
IanIrmischer
Occasional Contributor

I need to select the 3 features that have the largest attribute value. How is this best completed? I would like to do this within a model builder environment. I have been trying to figure out the sql statement within the select tool but am having syntax problems.

0 Kudos
5 Replies
Katie_Clark
MVP Regular Contributor

Have you seen this post? Might be helpful...

arcgis desktop - Using Select Layer By Attribute to return top 3 records - Geographic Information Sy... 

As the post states, "Python scripts in the form of custom tools can be used in Model Builder". 

Hope that helps at least a bit! Good luck!

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
IanIrmischer
Occasional Contributor

Thanks Katherine, I did see that. Just figured that since it seems like such an important query that ESRI would have a tool. Guess not.  

JoshuaBixby
MVP Esteemed Contributor

This is yet another example of where Esri has done a poor job of implementing SQL support in the file geodatabase.  If your data were stored in just about any other database, the query would be quite trivial, but doing something simple like this is way more complicated than it needs to be because Esri doesn't support TOP, LIMIT, or similar keywords.