In ascending order for all sorting variables (Dev_Period, AM, AY). I want to create a loop. For example, when Dev_Period = 1, Count_of_Dev_Period = 6, then I want to sum the first 6 values of cumulative_value when Dev_Period = 0, then use that sum as the denominator. I want to sum all values of cumulative_value when Dev_Period = 1 as the numerator. For example, when Dev_Period = 2, Count_of_Dev_Period = 5, then I want to sum the first 5 values of cumulative_value when Dev_Period = 1, then use that sum as the denominator. I want to sum all values of cumulative_value when Dev_Period = 1 as the numerator. So on and so forth. I haven't produced any code yet, but the code ChatGPT generates is beyond useable, so if anyone has any ideas, please advise. Thank you so much!
... View more