Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Fti
Contributor II
Contributor II

Nombre de patients présents dans le service à chaque heure

Bonjour, 

je suis nouvelle sur qlik et je suis bloquée en voulant calculer la charge d'occupation d'un service d'urgence par heure.

J'ai l'id des patients, l'heure d'entrée et de sortie de chaque patient. 

Par exemple, je veux calculer à 8h le nombre de patients qui sont entrés à 8h ou avant et qui ne sont pas encore sortis du service.

Labels (5)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Try using Floor() instead of Round(). Note also the slightly changed While clause:

charge:
load id_passage,
entree,
sortie,
Timestamp(Floor(entree,1/24)+(IterNo()-1)/24) as heure.charge
resident passage_qvd
While IterNo() <= Floor(24*sortie) - Floor(24*entree) + 1;

View solution in original post

4 Replies
hic
Former Employee
Former Employee

You need to create an extra table with one record per patient and hour. You can do this using a while loop.

Take a look at https://community.qlik.com/t5/Design/Creating-Reference-Dates-for-Intervals/ba-p/1463944. It is very similar to your problem. It describes how to create reference dates, and you need reference hours instead.

 

Probably something like

Patients_et_Heures:
Load
PatientID
Timestamp( Round(Entrée,1/24) + (IterNo()–1)/24 ) as HeureDeReference
Resident Patients
While IterNo() <= 24*Round(Sortie - Entrée) + 1 ;

Fti
Contributor II
Contributor II
Author

Hi Hic, thank u for your response. i'll try this.

hic
Former Employee
Former Employee

Try using Floor() instead of Round(). Note also the slightly changed While clause:

charge:
load id_passage,
entree,
sortie,
Timestamp(Floor(entree,1/24)+(IterNo()-1)/24) as heure.charge
resident passage_qvd
While IterNo() <= Floor(24*sortie) - Floor(24*entree) + 1;

Fti
Contributor II
Contributor II
Author

It worked. Thank u so much Henric.