Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
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 ;
Hi Hic, thank u for your response. i'll try this.
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;
It worked. Thank u so much Henric.