Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this set of data:
OPERATOR DATE
Andrew 06/02/2018 08:35:41
Andrew 06/02/2018 08:37:12
Andrew 06/02/2018 08:41:01
I would like to add a new column to display the next value, like this:
OPERATOR DATE NEXT
Andrew 06/02/2018 08:35:41 06/02/2018 08:37:12
Andrew 06/02/2018 08:37:12 06/02/2018 08:41:01
Andrew 06/02/2018 08:41:01 .....
I've tried with Peek without success
Thank you in advance
Maybe this
Tab:
LOAD * Inline [
OPERATOR, DATE
Andrew, 06/02/2018 08:35:41
Andrew, 06/02/2018 08:37:12
Andrew, 06/02/2018 08:41:01
];
NoConcatenate
Tab1:
LOAD RowNo() as Rno,*
Resident Tab;
Drop Table Tab;
Left Join
LOAD Rno-1 as Rno,DATE as NEXTDATE Resident
Tab1;
Maybe this
Tab:
LOAD * Inline [
OPERATOR, DATE
Andrew, 06/02/2018 08:35:41
Andrew, 06/02/2018 08:37:12
Andrew, 06/02/2018 08:41:01
];
NoConcatenate
Tab1:
LOAD RowNo() as Rno,*
Resident Tab;
Drop Table Tab;
Left Join
LOAD Rno-1 as Rno,DATE as NEXTDATE Resident
Tab1;
Try This:
AAA:
LOAD * Inline [
OPERATOR, DATE
Andrew, 06/02/2018 08:35:41
Andrew, 06/02/2018 08:37:12
Andrew, 06/02/2018 08:41:01
];
BBB: NoConcatenate
LOAD * Resident AAA Order by DATE Desc;
DROP Table AAA;
CCC: NoConcatenate
LOAD OPERATOR, DATE, Previous(DATE) as Next_DT Resident BBB;
DROP Table BBB;
Heyy
what if i want todays date as well in the middle. i want my data to be like this