I have a shapefile with a "Random Number" Column. I'd like to use ModelBuilder to Select and export the lowest N values. I've seen this post about selecting the top 10 records which is pretty similar.

Selecting limited TOP n from specific column in ArcGIS query builder?

But the problem I'm having is this post uses a Query Builder, but I'm not sure how to adapt this for model builder into the 'Select tool'. I'm using ArcGIS desktop


Run the data through the SORT tool, sorting by your random number field, sorting in an ascending sequence, send the output into IN_MEMORY.

For example input data is:

Initial data

The sort tool creates an FID field which is sequential, so all you need to so is select rows where FID <= 10 as shown below:

Sorted, lowest 10

If you need the lowest 20 then select FID <= 20. This can all be easily included into a model.

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.