Skip to main content

Use case: aggregating an average duration

This use case is implemented in a hospital, but it can be adapted to other contexts.

The objective is to calculate the average duration before the patient falls asleep, according to the type of intervention and the patient.

Data available is the sleep DATETIME and wake-up DATETIME for each patient and type of intervention. These DATETIME values can vary over time.

Two specific actions are performed:

  1. The difference in minutes between two DATETIME is calculated with a DATEDIFF subquery in SQL Server database. This value will be used to update the aggregate.
  2. In the wizard called Choose the columns, the GROUP BY category is filled with the columns corresponding to the patient and intervention type. The AGGREGATE category is filled with the columns that correspond to the number of interventions and the duration before the patient falls asleep.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!