Hello there!
In new ArcGIS version, sorting is now limited to 1 field. I don't have an advanced license and I need to sort my attribute table based on 2 fields. I was wondering if there is a python script for 2 field sort.
Thanks!
Cem
Solved! Go to Solution.
You could also use Sort—Help | ArcGIS for Desktop if you desire to create a copy of the table that is sorted by multiple fields.
Sorting records in a table by multiple fields—Help | ArcGIS for Desktop this doesn't work? And of course sorts aren't permanent in any event
Thanks for the reply Dan,
I forgot to mention that I need to sort the table permanently. The method you mention is a temporary sort so it does not change the table's original order.
Best,
Cem
You could also use Sort—Help | ArcGIS for Desktop if you desire to create a copy of the table that is sorted by multiple fields.
Thanks for the reply Wes,
I found that page after I posted. However, there is still a problem with "Python Window" version. I get this warning:
Runtime error Traceback (most recent call last): File "<string>", line 6, in <module> File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 4351, in Sort raise e ExecuteError: ERROR 000824: The tool is not licensed.
>>>
It seems ArcGIS requires Advanced License for advance permanent sorting in ArcGIS environment. However, I tested stand-alone Python script version and finally that one worked well.
Best,
Cem
Yes to sort by shape or multiple fields requires an Advanced license see below.
For the Field(s) parameter, sorting by the Shape field or by multiple fields is only available with anAdvanced license. Sorting by any single attribute field (excluding Shape) is available at all license levels.
ahhhh, but then there is numpy
I'm waiting for you to open the group
However, advanced sort still doable with stand-alone python script without advanced license.. which is good
Just so you are aware. It is likely that you have a license manager and an Advanced license is available when you run your python script. I am unable to locate the documentation to support this,but I've read that arcpy gets the highest license available unless you explicitly set the license.