Hello,
I'm trying to create an attribute rule that will create a sequential count of features in one field (NumberID) based on their value in another field (Category). An example is below. Whenever a feature is inserted, updated, or deleted, I'd like the counts in the NumberID field to automatically recalculate based on the occurrences of the values in the Category field. I want the count for each category to start at 1, so a geodatabase sequence doesn't seem to be the way to go. The previous NumberID values don't matter. In other words, it doesn't matter if a feature numbered "1" later becomes "2" as long as every feature in that category is numbered sequentially without skipping any numbers.
Category NumberID
Category1 1
Category1 2
Category1 3
Category2 1
Category3 1
Category3 2
I had some success modifying the solution in the post below to create the counts, but it doesn't recalculate the counts when I delete features. I'd like the NumberID values to recalculate whenever there's an edit so each feature is always numbered 1, 2, 3, etc. by each category.
Solved: Re: Sequentially/incrementally numbering a data po... - Esri Community
Does anyone have any suggestions for how to do this? Thank you!