Hi Pooja x,
you can indeed read the next record from an already read in input table, like in your sample. peek function takes up to three parameter, with second you can specify the record number and with third the input table.
loginDate as login,
peek('logoutDate',recno(),'Final') as logout
recno() starts counting record with 1, but peek the field index with 0, so just a recno() will ask for the next record of the input table.