I need to update the Date2 column by calculating the next record_date of the ID. (i.e) The Date2 column should be (record_date-1) of next record_date of ID
My dataset is like:
ID Date1
123 05-06-2012
123 06-08-2012
123 09-09-2013
234 05-04-2014
234 06-09-2014
I need cumulative type date format (i.e) Expected results
ID Date1 Date2
123 05-06-2012 05-08-2012
123 06-08-2012 08-09-2013
123 09-09-2013 NA
234 05-04-2014 05-09-2014
234 06-09-2014 NA