Skip to main content

I have a set of transactions with date and timestamp fields.

I wish to calculate arrival rate (no. of transactions per minute) for each hour.

What I have is a calculated field:

TRAN_COUNT = COUNTD(Order_key);

 

How do I specify an aggregate calculation: Number of minutes =  MINUTES(Max(timestamp) - Min(Timestamp)

so I can then have ARRIVAL_RATE = TRAN_COUNT / NUM_MINUTES

3 answers
  1. Nov 18, 2013, 7:55 AM

    MINUTES(Max(timestamp) - Min(Timestamp)

    This can be calculated this way:

    .

    DATEDIFF('minute', MIN([Timestamp]), MAX([Timestamp]))

    .

    Just remember that DATEDIFF cuts off the seconds when calculating, such as counts:

     

    09:03:59 to 09:04:00 as 1 minute (but only 1 second) and

    09:03:00 to 09:03:59 as 0 minute (but 59 seconds)

     

    Ps. It is easier to attract helpers when a packaged workbook is attached:  Sending a Packaged Workbook

0/9000