Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
younesnab
Contributor
Contributor

Date canonique

 

Bonjour, 

 

Je travaille à l'aide de fichier QVD avec une vingtaine de tables. Dans a peu près chaque table il y a un champ date.

Afin de créer un calendrier principal j'ai crée un DateBridge regroupant les champs date des tables relié à ma table maitre. 

Voici l'exemple: 

DateBridge:


Load
'person.created_at' as DateType,
patient_id,
Date(FLOOR(person.created_at),'DD/MM/YYYY') as Date
Resident person;

Load

'person.confirmed_at' as DateType,
patient_id,
Date(FLOOR(person.confirmed_at),'DD/MM/YYYY') as Date
Resident person;

Load
'record_signins.created_at' as DateType,
patient_id,
Date(FLOOR(record_signins.created_at),'DD/MM/YYYY') as Date
Resident record_signins ;

 


Load
'quiz_playbacks.created_at' as DateType,
patient_id,
Date(FLOOR(quiz_playbacks.created_at),'DD/MM/YYYY') as Date
Resident quiz_playbacks ;

 

 Load


'program_playbacks.created_at' as DateType,
patient_id,
Date(FLOOR(program_playbacks.created_at),'DD/MM/YYYY') as Date
Resident program_playbacks ;

 


Load
'assigned_program.created_at' as DateType,
patient_id,
Date(FLOOR(assigned_program.created_at),'DD/MM/YYYY') as Date
Resident assigned_prog ;

 

Après avoir créé mon DateBridge je l'ai relié à mon Mastercalendar. Jusqu'ici tout fonctionne mais le problème apparait quand je veux utiliser l'expression count en ne sélectionnant un DateType précis. 

 

Exemple :  

count({<[program_playbacks.completion_status]={'0','1'}, DateType={'program_playbacks.created_at'}>}DateType)

Cela me renvoie une mauvaise valeurs quand je ne sélectionne aucune date , tandis que quand je touche à la date cela me renvoie la bonne valeur . 

 

J'ai essayé cette formule : 

count({<[program_playbacks.completion_status]={'0','1'}, DateType ={'program_playbacks.created_at'}>}program_playbacks.created_at)

mais cette fois j'obtiens la bonne valeur sans toucher au champs date, mais par contre une fois que je change la date il apparait que des mauvaise valeur. 

Pouvez-vous svp m'éclairer. 

Labels (6)
2 Replies
AustinSpivey
Partner - Creator
Partner - Creator

It's hard to say for sure, but I suspect that this is happening because of how you set up the data model and/or how you are handling Null values. When you count with the [DateType] field, you may not be accounting for Nulls values in selected DateTypes.

AustinSpivey_0-1677878847151.png

 

If I used the table from the screenshot above and tried to do:

=Count({<[DateType={'program_playbacks.created_at'}>} [DateType])

...then it would return one 1 instead of what it should return, which is zero 0.

I don't know what your use case is with these calculations but if you can use =Count([Date]) or =Count([patient_id]) instead, that may prove to be a more accurate count.

Austin Spivey | Principal Consultant @ Arc Analytics
ArcAnalytics.us | Add me on LinkedIn
younesnab
Contributor
Contributor
Author

thank you, for your answer actually patient_id and date field is more accurate