Skip to main content
Solved

Count by two attributes and restart when one changes

  • October 13, 2024
  • 3 replies
  • 55 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

 

 

View original
Did this help you find an answer to your question?

3 replies

hkingsbury
Celebrity
Forum|alt.badge.img+55
  • 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)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings