I have data set with columns - Reporting date, Flag 1 and 0 and account number.
So for one account we have multiple reporting date starting from Jan 2001 until Dec 2008.
Flag has value 1 and 0.
My requirement is to identify the month where flag becomes and 1 and fetch last 12 months data.
For example if flag becomes 1 in Dec 2008, then we should get the data for that account starting from Jan 2008 till Dec 2008.
I tried reshape and managed to pull the default date but now I need to fetch only last 12 months data.
I'm trying to do this in R. Any suggestion please.