comparison between lines

5 posts / 0 new
Last post
Ahmed
Offline
Joined: 09/20/2017 - 05:45
comparison between lines

Hi;
I've a database that I need to compare between the line 1 and the line 2 ...e, 
for example :  
In this case; i need to get the difference between the start call of line 2 with the end call of line 1  and 
 Thank you.

START CALL
DURATION
Duration_HOURS 
End_Call

17:26:18
139
00:02:19
17:28:37

17:28:50
60
00:01:00
17:29:50

17:29:52
45
00:00:45
17:30:37

Ahmed
Offline
Joined: 09/20/2017 - 05:45

I'upload a file .xlsx

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Ahmed,

If I understand what you want you can do this by creating a vritual numeric field with this equation:

@if(@Recno() =1, 0, @Tton(START_CALL) - @Tton(@GetPreviousValue("END_CALL")))

So if it is the first record just put 0 into it.  It then takes the number of seconds from the START_CALL and subtracts the number of seconds the previous END_CALL.  The one problem will be when you switch days.  It also assumes the file is in order by START_CALL.

Brian

Ahmed
Offline
Joined: 09/20/2017 - 05:45

Hi Brian,
yes, the problem will be when the date is different; but now what i'm doing is summurizing by date. 
for the rest, thank you very much for your help.

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Not a problem, glad I could help.