I have data similar to below.
UID EventId Status
-------------------
1 1 C
1 2 D
1 3 D
1 4 C
1 5 B
2 1 A
2 2 A
2 3 D
2 4 C
3 1 D
I need to create a status_counter like below. Status counter is incremented every time there is a change in the status. Has anyone worked on something like this. Can someone help me out here. Appreciate your help.
UID EventId Status Status_Counter
-------------------------------------
1 1 C 1
1 2 D 2
1 3 D 2
1 4 C 3
1 5 B 4
2 1 A 1
2 2 A 1
2 3 D 2
2 4 C 3
3 1 D 1