Select to view content in your preferred language

To select a record based on the highest value  of a field?

5936
25
Jump to solution
07-09-2013 06:17 AM
ionarawilson1
Deactivated User
Is there a way to select a record based on the highest value  of a field? And also is there a way to check if a record is selected based on the highest value before I update a record? Thanks
Tags (2)
0 Kudos
25 Replies
RhettZufelt
MVP Notable Contributor
Rhett, Please disregard my dumb question 🙂
It was really the problem with the tab! It is working great! I will post another thread if I have any more questions about the updating of rows using this type of selection! Thank you so much! You rock!


I was wondering if you posted that before you saw the last post about the tab.  That was confusing as could be, as my code "looked" the same, but I got different results typing it in vs running my script.

As far as the sort and fields, the myField+" D" lets me pass the field as a variable so I can use in a def for multiple FC's.  As you can see in my last posting, I hard coded it to OBJECTID, so can be done either way.

R_
0 Kudos
RhettZufelt
MVP Notable Contributor
I created a toolbox and added the script and I am running from there, when I click on the script.


Makes sense.  So, Arc is doing the featurelayer for you.  Keep in mind that if you ever try to export this out as standalone, you will get the error and have to MakeFeatureLayer first for the selection tool.

R_
0 Kudos
ionarawilson1
Deactivated User
But if somebody has the same feature classes in arcmap and creates a tool and run the script like I am doing, it should work, right?
0 Kudos
RhettZufelt
MVP Notable Contributor
I believe so.

Not sure, but it is my understanding that, running within arc, arc will on the fly create/substitue a feature layer for tools that require it, so if the FC's are the same, I think the tool will work fine.

R_
0 Kudos
ionarawilson1
Deactivated User
Thank you Rhett, I am going to create another thread because I have a question about the query for the select by attribute parameter! Thank you again!!!
0 Kudos
ionarawilson1
Deactivated User
James, thank you for the idea about the numpy array. I might try that also!!! Thanks!!!
0 Kudos