Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating duration between to date time stamps

Hi,

I have read just about all of the discussions on this issue, and am not able to resolve my issue.

I am extracting data from MySQL, for the SugarCRM system that we use. The date/time format looks like this:

how can I go ahead to calculate the exact time it took to close the query, if the 'Last modified' field that I use, saves it in the same format.

I have read the Datefield tech brief document trying to get answers, but none of those work. I have attached the qvw. I need the answer given to display as 'hh:mm:Ss'

Thanks

8 Replies
buzzy996
Master II
Master II

try this way,

=Interval(Interval(Sum(ProProductiveTime),'hh:mm:ss') - Interval(Sum(ProNonProductiveTime),'hh:mm:ss'),'hh:mm:ss')

Not applicable
Author

Thanks Shiva,

Do I load this in my load statement or expression tab?

buzzy996
Master II
Master II

on expression field,not on edit script.

Not applicable
Author

Thanks. works. if I want to now get max/min/avg? just add the to the front of statement?

buzzy996
Master II
Master II

yes,if not works u have little bit twist tht expression.

Not applicable
Author

is there no way that I can do this in the load script to create a new field i.e "Total time"?

buzzy996
Master II
Master II

definitely u can do,but i doubt that interval function will work or not though load stmt.

Anonymous
Not applicable
Author

The interval() function works perfectly in the load script.  So give it a go and you'll see it works.