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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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

Labels (1)
6 Replies
sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

Awesome

Not applicable
Author

Thanks for your help.