Hello.
I'm doing my final work at university and I get some doubts.
In first place I wanna know if there's some way to access data in the next row.
In order to access previous row data I used Lag series operator but I can't find the way to do so on the next register.
My data is like this:
Discussion Userid Parent Created Modified
1 1 0 12 14
1 2 82 15 16
1 1 85 17 20
1 3 85 22 24
2 45 0 26 32
2 48 89 33 34
2 46 90 34 35
I wanna calculate, for each userid, difference between modified(i+1)-created(i).
The attribute parent=0 means that's the first message on a discussion.
With that I wanna to calculate how many time is the between a message from a userid and his response.
For the first row I wanna 1 1 0 (16-12)=4
How can I do that? Is there a way to know what row corresponds to the last message of a discussion? How can I underline the previous row of a row with parent=0?