Hi all,
I need to populate a field with sequencial numbers.
I could go the easy way and input in the field calculator: FIELD = 1+ [FID]
But I want my data to be first sorted so what i would like would be more something like
1) Sorting my data
2) FIELD = ROW
And so once sorted the FID is not relevant to the row number...
I've read things online and it seems that autoIncrement is my solution but I can't seems to have it working.
Here is the code I got from the help:
Expression:
autoIncrement()
Expression Type:
PYTHON_9.3
Code Block:
rec=0
def autoIncrement():
global rec
pStart = 1 #adjust start value, if req'd
pInterval = 1 #adjust interval value, if req'd
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval
return rec
Here how I input it:
Here's my error message:
My field i'm trying to populate is called label and is a short integer.
Any ideas?