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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Subtracting times

Hi

I have a field that calculates an average call time.

From this value, I want to take away 3 mins 30 seconds into a text box. What is the correct expression to use?

Currently I've got:

=time(Avg(CallTime),'hh:mm:ss')-(time(003330),'hh:mm:ss')

which obviously isn't working!! Hope you can help!

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Interval(interval#(000330, 'hhmmss'),'hh:mm:ss')

It will display:

Time.PNG

View solution in original post

9 Replies
sunny_talwar

Slight Change: 3 mins and 30 seconds will be 000330 instead of 003330

Try this:

=Interval(Interval#(CallTime,'hh:mm:ss') - Interval#(000330,'hhmmss'), 'hh:mm:ss')

sunny_talwar

Posting a document where I used it in a text box with CallTime = '10:52:30'

Anonymous
Not applicable
Author

I've tried the expression, but still coming up with an error. I've tried with both interval# and time#

buzzy996
Master II
Master II

try tis,

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

sunny_talwar

Can you share a sample of where is not working?

Best,

Sunny

Anonymous
Not applicable
Author

I've just tested displaying 000330 in a time format.

=time(000330,'hh:mm:ss')

This returns a text box of 00:00:00. So the only point of failure is trying to get the 3 minutes and 30 seconds to display correctly.

sunny_talwar

Try this:

=Interval(interval#(000330, 'hhmmss'),'hh:mm:ss')

It will display:

Time.PNG

Anonymous
Not applicable
Author

Perfect!

=interval(time(avg(calltime),'hh:mm:ss') - interval#(000330,'hhmmss'),'hh:mm:ss')

Gives me exactly what I need

Thans for your help!

sunny_talwar

That's what I kind of gave earlier also. It didn't have Avg() in it. But I am glad it all worked out for you in the end.

Best,
Sunny