Hi
I have below dataset,
I want to get like below
The logic for Q1 and Q2 is,
Week 1 has 2 count (A01 & A02) so Q1 start with 2 from week 1. Then A01 QI changed to Q2 in week 8 and also for A02. so from week 8 onwards 2 count for Q2.
Then Week 14 A01 changed to Q1 again and A02 remain Q2
So Q1 is i from Week 14 to until next change and Q2 is also 1 (A02) until next change.
How to achieve this?