Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Applicable88
Creator III
Creator III

Column and KPI Window for displaying the average duration time

Hello,

I have a table with a ordernumber and two additional columns with Starttime and Finishtime.

I used following function for showing me the timedifference (duration) of the ordernumber :

=sum(interval(FinishTime-StartTime,'mm.ss')) shows me the duration in minutes and seconds. 

Now I need a additional column for the average duration of all selected ordernumbers. 

I tried putting the avg function or divide the formula through the distinct counts of orders, but still getting wrong values. 

I need that for a additional column and for a kpi window.

I hope someone knows a proper solution.

Thank you very much in advance. 

 

 

Labels (1)
2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

most probably you won't get any replies if you don't put some basic additional information:

- sample data

- what is wrong

- what is expected

Applicable88
Creator III
Creator III
Author

Hello ,

I agree, should have put more data. 

Here I have a sample table:

Ordernumber

Starttime

Finishtime

Duration

 

12345

06.07.2020 09:15:48

06.07.2020 09:21:36

05.47

 

23456

07.07.2020 12:37:38

07.07.2020 12:38:55

01.17

 

78954

07.07.2020 12:44:17

07.07.2020 12:44:23

00.05

 

45621

24.08.2020 13:37:59

24.08.2020 13:38:40

00.41

 

 

So here I have example of orders and each order has to be prepared in a process. That will be documented with a starttime and a finishtime. For calculating the duration which is the subtraction of Finishtime - Starttime in the format of minutes and seconds, I use the interval()-funcion: 

=interval(FinishTime-StartTime,'mm.ss')

Now I need a additional column and kpi-window which showes me the avg duration time of the ordernumbers that I want to select. 

The following function gives me as expected the sum of durationtime of the selected orders  properly:

=sum(interval(FinishTime-StartTime,'mm.ss'))

So I when I need  the average time of all selected orders I would expect the following to work:

=avg(interval(FinishTime-StartTime,'mm.ss'))

 

But instead I get these weird numbers: 

Ordernumber

avg(interval….

12345

0,004027431

23456

0,000898148

78954

6,55E-05

45621

0,000476458

 

 

Hope I explained my problem better this time.

Thank you in advance.