This post is to assign value of last row to first row: Move last value to first value.
I would like to move the value in the second duplicate to the first duplicate and set others to NaT.
ID OutBedTime DateOutBed 1 16/05/2018 0:17 16/05/2018 1 16/05/2018 4:05 16/05/2018 1 16/05/2018 6:05 16/05/2018 1 17/05/2018 1:27 17/05/2018 1 17/05/2018 4:41 17/05/2018 1 17/05/2018 5:32 17/05/2018
Expected output
ID OutBedTime DateOutBed TimeOutBedFinal 1 16/05/2018 0:17 16/05/2018 16/05/2018 4:05 1 16/05/2018 4:05 16/05/2018 NaT 1 16/05/2018 6:05 16/05/2018 NaT 1 17/05/2018 1:27 17/05/2018 17/05/2018 4:41 1 17/05/2018 4:41 17/05/2018 NaT 1 17/05/2018 5:32 17/05/2018 NaT
Thank you.