Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
sarath_babu
Contributor II
Contributor II

Calculating Avg(Time Difference)

Hi All,

Am new to QlikSense . I have used interval function to calculate time difference . But the result is not matching with the database.

Interval(start_time-date,'hh:mm:ss') As DiffTime

Both date ares in yyyy-mm-dd hh:mm:ss format

Can you please suggest any other way to solve this

4 Replies
Anil_Babu_Samineni
MVP
MVP

Will you able to provide few rows of data?
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sarath_babu
Contributor II
Contributor II
Author

This is how data is in the database

StartTime, Date,Average

2018-09-10 07:02:302018-09-10 07:01:2200:01:08
2018-09-26 23:08:332018-09-26 23:07:2500:01:08
2018-08-30 07:40:432018-08-30 07:39:3600:01:07
2018-09-04 02:48:402018-09-04 02:47:3400:01:06
2018-10-04 07:50:152018-10-04 07:49:0900:01:06
2018-08-07 12:16:382018-08-07 12:15:3200:01:06
2018-08-08 02:42:032018-08-08 02:40:5800:01:05
2018-10-30 23:13:292018-10-30 23:12:2600:01:03
2018-10-09 22:35:092018-10-09 22:34:0800:01:01
2018-10-19 02:27:172018-10-19 02:26:20

00:00:57

Anil_Babu_Samineni
MVP
MVP

PFA, I don't see any problem using your condition in script and UI

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sarath_babu
Contributor II
Contributor II
Author

Hi Thanks for the reply..

actually i need to calculate the first occurrence of date.

Interval(startTime-min(date),'hh:mm:ss') as Diff

then Avg(Diff) as ResponseTime.

But in the front end i got the values like '23:56:55' which should be like '00:00:40'. 

That is the reason i have asked for alternate function other than interval.