Forum Discussion
cumulative count based on a key.
- 7 years ago
If you can have an extra column with a unique, consecutive numerical ID (index), I think the code below should work. You can add an index column easily in the query editor (see the solution on this post)
Table[Accumulated] = COUNTROWS ( FILTER ( Table; Table[Collect Key] = EARLIER ( Table[Collect Key] ) && Table[ID] <= EARLIER(Table[ID]) ) )
Hi Anonymous,
Do the rows you want to number (with same collect key) have exactly the same values on each column (as it appears from the attached image)?
Does each row have a unique identifier (like a row number)?
If you attached a sample with the table it would probably be easier for people to help.
.
- Anonymous7 years agoNot applicable
I am unsure of how to attach a sample. Hopefully, the amended post will suffice.
Thanks, Shem
- AlB7 years ago
Community Champion
If you can have an extra column with a unique, consecutive numerical ID (index), I think the code below should work. You can add an index column easily in the query editor (see the solution on this post)
Table[Accumulated] = COUNTROWS ( FILTER ( Table; Table[Collect Key] = EARLIER ( Table[Collect Key] ) && Table[ID] <= EARLIER(Table[ID]) ) )- Anonymous7 years agoNot applicable
Thanks, it worked perfectly!