Hi, first let me apologize for not being more clear on the title as I am not sure how to discribe what I am looking for in just a few words. I am essentially trying to derive the Extended Penalty column in the table below: Date Mistakes_Flg Number Of consecutive mistakes Penalty Extended_Penalty 1/1/2013 0 0 0 0 1/2/2013 1 1 10 0 1/3/2013 1 2 10 0 1/4/2013 0 0 0 0 1/5/2013 1 1 10 0 1/6/2013 1 2 10 0 1/7/2013 1 3 10 0 1/8/2013 1 4 10 0 1/9/2013 0 0 0 10 1/10/2013 0 0 0 10 1/11/2013 0 0 0 10 1/12/2013 0 0 0 10 1/13/2013 0 0 0 0 where if the person makes mistakes for 3 or more consecutive days, he gets punished by paying an daily extended penalty of the previous penalty equal to the number of consecutive days he made a mistake. In my example, the first time he made a mistake for 2 consecutive days, no extended penalty has incurred since it's less than the 3 days criteria. However, he then made a mistake for 4 consecutive days, therefore he will have to pay the extended penalty for 4 more days after he stop making mistakes. Can someone help I tried everything and I can't get it work! Thanks a bunch in advance!
... View more