5 Replies Latest reply: Aug 27, 2012 12:58 PM by Jeroen Scheper RSS

    Average waitingtime

      Hi experts,

       

      i have a table with a startdate and a enddate.

      In my script i have a field that calculates the difference between those fields.

       

      INTERVAL(ENDDATETIME - STARTDATETIME) as HandlingSpeed

       

      So when i look at my table i have the following date in it:

      ID     Type  StartdateTime            EnddateTime            HandlingSpeed.

      1      A       01-01-2012 14:00:00  01-01-2012 14:00:30  0.30

      2      A       01-01-2012 14:00:00  01-01-2012 14:01:30  1.30

      3      B       01-01-2012 14:00:00  01-01-2012 14:00:20  0.20

      4      C       01-01-2012 14:00:00  01-01-2012 14:01:10  1.10

      5      B       01-01-2012 14:00:00  01-01-2012 14:00:40  0.40

       

      Now i want the average handlingspeed per type.

      I made the following expression:

      =avg(aggr(Sum(HandlingSpeed),Type))

       

      this will not give the right answer, does anyone have a idea what i did wrong? I think the problem is in the time format ?!