0

This question already has an answer here:

Is there a way to auto populate a sequence of numbers based on another attribute in a table?

For example, if field "Name" has a sequence of numbers from 1 to 10, and I want to number all the rows in the table that associated to "Name = 1" from 1 to 10, and then start this process over when "Name = 2" etc (see attached graphic).

Can this be done within the Field Calculator, with a plugin, or does it need to be coded?

enter image description here

marked as duplicate by Devdatta Tengshe, whuber Feb 19 '13 at 6:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

I was able to get some help from someone here, and thought I would share the results:

counter = 0
p_name = ""

def count_values(name):
  global counter
  global p_name

if p_name == "":
  counter += 1
elif p_name == name:
  counter += 1
elif p_name != name:
  counter = 1

p_name = name

return counter
__esri_field_calculator_splitter__
count_values(!Name!)

Not the answer you're looking for? Browse other questions tagged or ask your own question.