Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation of difference in time

Hi All,

My requirement is, i have a date and time field in an excel and i have to calculate the difference between various timings. Interval works fine if i select two timings. but i want time difference for all timings.

Eg:

Time:

00:08:49

00:18:48

00:28:46

00:38:44

I Want

Time             Diff

00:08:49         Null

00:18:48        00:09:59

00:28:46        00:09:58

00:38:44        00:09:58

I tried different expressions but am not getting this result. I would be very great ful if anyone provide some ideas for this.

PFA Excel.

Thanks in advance.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try this:

Times:

load Date, Localtime,

interval(Date+Localtime - previous(Date) - previous(Localtime),'hh:mm:ss') as TimeDiff

FROM TestTime.xlsx (ooxml, embedded labels, table is Sheet1);


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Try this:

Times:

load Date, Localtime,

interval(Date+Localtime - previous(Date) - previous(Localtime),'hh:mm:ss') as TimeDiff

FROM TestTime.xlsx (ooxml, embedded labels, table is Sheet1);


talk is cheap, supply exceeds demand
er_mohit
Master II
Master II

hi

see the attached file

Not applicable
Author

I have used the Above() function in a table chart to get the interval (Only(LocalTime) - Above(TheTime)). Attached you have an example with your data.

JG

Not applicable
Author

Thanks Gysbert, Thanks for your solution.