1

I want to enumerate how many times an event occurs consequently without a break, if it breaks, the count will restart from the beginning, for example input Date and Event, the Count should be:

| Date | event| Count |
| ---- | -----| ----- | 
| 1    |  A   |   1   |   
| 2    |  A   |   2   |
| 3    |  B   |   1   |
| 4    |  A   |   1   |
| 5    |  B   |   1   |
| 6    |  B   |   2   |
| 7    |  B   |   3   |
| 8    |  A   |   1   |
| 9    |  A   |   2   |

Does anyone have any idea how to solve this? Thanks

I tried the rank function, but it will continue to count the previous event when it occurs again.

Qing
  • 17
  • 4
  • @HenryEcker thank you. I was obviously not using the correct search terms as I could not find those answers. I've bookmarked the best one for future reference. – Nick Apr 27 '23 at 01:10

0 Answers0