Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Iterative position within Field Calculator/Python

I need to calculate a field for a data set that is grouped by county. At each change in county I need the column to start from 1 and progress up until the end of the county group and then start over.

share|improve this question

marked as duplicate by whuber Apr 20 '12 at 15:47

This question was marked as an exact duplicate of an existing question.

Can you please provide more detail? i.e. version, and maybe a screenshot of the dbf? – Emily Apr 20 '12 at 15:17
Please be more descriptive -- I don't follow the "at each change in county I need the column to start from 1 and progress..." – Roy Apr 20 '12 at 15:20
So I have a large set of grids that overlay each county and there is a column named 'County' with the name of that county. There is a column named 'Tile' that needs to start at the integer '1' and each new grid would progress by +1 until the end of the county group. Then the next county group would start over at '1' and progress by +1. – Andy Apr 20 '12 at 15:20
This is very similar to this question:… – Stev_k Apr 20 '12 at 15:30
Thank you for pointing me to that. I looked and must have passed over this. – Andy Apr 20 '12 at 15:32

Using Python in the field calculator is really best for very simple operations. Any time you have to change values based on a field, it gets a bit too complicated for my liking. You might want to script it instead using cursors

share|improve this answer

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