Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable expression for average time

Hello Guys,

I am trying to create a variable with the below expression:

=interval(Avg({<Date={'>=$(=Date(Max(Date)))<=$(=Date(Max(Date)))'}>}conv)/24, 'hh:mm:ss')

The conv is the conversation time but unfortunately there is something wrong with the formula.

When i do the expression as below i get the answer in numeric but I need it in time 'hh:mm:ss'

=Avg({<Date={'>=$(=Date(Max(Date)))<=$(=Date(Max(Date)))'}>}conv)

Any suggestions.

Thanks,

Hasvine

6 Replies
sunny_talwar

Why do you need to divide your expression with 24? What number do you get when you don't use interval function?

Not applicable
Author

The answer i get is 0,001787003

Not applicable
Author

I tried removing the /24 and its working great.

Thanks

sunny_talwar

If the output you are expected it 00:02:34 then try this:

=Interval('0.001787003', 'hh:mm:ss') or without 24

=interval(Avg({<Date={'>=$(=Date(Max(Date)))<=$(=Date(Max(Date)))'}>}conv), 'hh:mm:ss')

sunny_talwar

Awesome

Not applicable
Author

Thanks for your help.