ArcGIS Pro 3.3.1; file geodatabase
I want to use the field calculator to populate a new/blank field called ROW_NUM.
- For each group, using sequential numbers starting at 1, ordered by the VALUES field (descending)…populate the ROW_NUM field.
GROUP_ID VALUES ROW_NUM
1 0 2
1 1 1
1 0 3
2 0 1
2 0 2
3 1 1
3 0 3
3 1 2
It is my understanding that can’t currently be done using the Calculate Field tool (Python). Could that functionality be added?
If it were an Oracle SQL query, it would look like this:
select
GROUP_ID,
VALUES,
row_number() over (partition by GROUP_ID order by VALUES desc) as rn
from
MY_TABLE