Hi dear community.
I need to accumalate value of one field by order of other field.
I sucsses to accumlate value but the order detaramine by "OBJECTID"
who can i change that?
thanks
itay
Hello Itay! You can use update cursor in python do achieve what you want. In the sql_clause parameter there is one exemple of the epression used with ORDER BY
https://pro.arcgis.com/en/pro-app/3.1/arcpy/data-access/updatecursor-class.htm
with arcpy.da.UpdateCursor(
in_features,
['OID@', "ELEVATION"],
sql_clause=("TOP 5", "ORDER BY ELEVATION DESC")
) as cur:
thank you pedro
i will try your solution
hopes that it's work for me
best regards
itay
Dear itayroei,
I hope you are doing well,
If you are using ArcGIS Pro, you can do by this way, insert a New Notebook,
and write the python script like below image,
Here I read the Airports feature layer as a Pandas DataFrame, you should put your feature layer's name.
Then I have sorted by scale value, which you should put the name of the column which you want to sort the dataframe, and then create a new column which is accumaled values of size column which you should put yours.
If need more info please let me know.
Hope it works,
Best Wishes
thank you Amir
i will try your solution in sundey and let you knew if it's work for me
good weekend
itay