Hello everyone, first of all, I apologize if the sentencing of my question is not correct.
I am working on a dataset where I need to create a new flag variable based on the prior row value of the same variable. Please find attached the sample dataset for your reference along with the desired output shown.