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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
gautik92
Specialist III
Specialist III

Average

I have a table with start time and end time lik this

EmplID      StartTime   EndTime

1                08:00:00      10:00:00

2                10:00:00      11:00:00

I want to calcluate average time spent

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Assuming that the start time and end time are proper QV time values, then

     Interval(Avg(EndTime - StartTime))

If they are string values

     Interval(Avg(Time#(EndTime, 'hh:mm:ss') - Time#(StartTime, 'hh:mm:ss')))


Interval can also take a format parameter, so you can format the result (for example as hours  Interval(..., 'h')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
Not applicable

Hi,

sum((StartTime-EndTime)/(StartTime+EndTime))

Not applicable

Hi,

You can also use the avg function

jonathandienst
Partner - Champion III
Partner - Champion III

Assuming that the start time and end time are proper QV time values, then

     Interval(Avg(EndTime - StartTime))

If they are string values

     Interval(Avg(Time#(EndTime, 'hh:mm:ss') - Time#(StartTime, 'hh:mm:ss')))


Interval can also take a format parameter, so you can format the result (for example as hours  Interval(..., 'h')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
gautik92
Specialist III
Specialist III
Author

it dint work