Skip to main content
Solved

Count by two attributes and restart when one changes

  • October 13, 2024
  • 3 replies
  • 76 views

huundriks2
Participant
Forum|alt.badge.img+2

Hi, This is defeating me!
Any pointers sincerely appreciated.

See attached spreadsheet, Where I have features with attributes having multiple similar IDs as well as a name attribute.

I have added the columns _num and _page, that is the desired output I manually added in.

I can achieve the _num output easy enough with a counter set to Local and group by the two Attributes Name and ID. I set the Count to be _num and Group ID to be _page. This works fine until the Name group changes and the _page will continue counting, See screenshot. However, when the new Name starts with B I want the _page to restart at 1. How do I set it? 
Thanks. Nic

 

 

Best answer by bwn

This can alternatively be done with AttributeCreator using Adjacent Feature Processing.  It works very similarly to Counter but gives fine grained control when to increment or restart the Count using Conditional Values

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

hkingsbury
Celebrity
Forum|alt.badge.img+65
  • Celebrity
  • October 13, 2024

You could put the counter in a custom transformer, then set that custom transformer to Group By on the Name attribute


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • Best Answer
  • October 13, 2024

This can alternatively be done with AttributeCreator using Adjacent Feature Processing.  It works very similarly to Counter but gives fine grained control when to increment or restart the Count using Conditional Values

 

 


huundriks2
Participant
Forum|alt.badge.img+2
  • Author
  • Participant
  • October 14, 2024

Wow bwn, that is a nifty solution! Had not thought of doing it that way at all, just got stuck with the counter or even tried the Stats calculator (which I also wouldnt get to work).
Thanks heaps!
If you are ever in South West Victoria. Aussie, drop by and I will cook you a nice meal ;o)