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

Average Duration Calculation

Hi Experts,

Can any one please help me on below requirement.

From the START_TIME and END_TIME fields I have calculated Duration like

Interval(END_TIME-START_TIME ,'hh:mm')

How to calculate Average Duration from START_TIME and END_TIME.

I have tried like Interval(Avg(END_TIME-START_TIME) ,'hh:mm') but getting same as Duration Time.


Please help me on this.

Thanks in advance.

5 Replies
shiveshsingh
Master
Master

Hi

Try

AVG(Interval(END_TIME-START_TIME ,'hh:mm'))

raman_rastogi
Partner - Creator III
Partner - Creator III

hi bhavani

for single line record you will get avg (interval) same as your normal interval , avg values are calculate based on total number of records.

ex- avg(interval)= interval/ total rows

by using AVG(Interval(END_TIME-START_TIME ,'hh:mm')) you can get avg value at your total field.


 

Raman

shiveshsingh
Master
Master

Can you share sample data?

or inline data?

bhavvibudagam
Creator II
Creator II
Author

Hi Raman,

Thanks for your reply.

Suppose i want to see the avg duration of jobs run in my data base using start time and end time how to calulate the avg duration.

My dimension is Job Name. for avg duration Interval(END_TIME-START_TIME ,'hh:mm')/total rows how to consider



raman_rastogi
Partner - Creator III
Partner - Creator III

bhavani

can share sample data with desirable output

meanwhile try this

avg(Interval(END_TIME-START_TIME ,'hh:mm'))/rowno()


this expression will you avg with respect to Job Name if one job name have many start and end dates.

raman