Hai, I appreciate that my explanation could have been clearer, my apologies The most recent month would be month96 - the window is a 96 month period (last 8 years) As for the status, the status is defined anything not missing, in the case of my example 0,1,2,3 and 4 are statuses so 4 is the worst The outcome I am looking for is to be able to calculate the max value, a defined number of periods back based on the last status filed - so in my example if you take customer 1002 - that customer is present in four periods, I would like to be able to find the last period that customer filed a status in, and then find the max value in the last 3 periods (the answer would be 4) I am using shortened numbers in my example data to simplify the scenario Kind Regards Tom
... View more