Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Average Number of Visits

Hello,

I have multiple patients (PatientID) visiting a hospital (VisitID) multiple times 

I am trying to find the average number of visits per patient 

Is this possible? 

Thank you 

5 Replies
Highlighted
MVP
MVP

Re: Average Number of Visits

How VisitID associated with PatientID?

I mean if the same Patient visit multiple times then he/she allocated different VisitID everytime?

 

Try something like below.

Avg(Aggr(Count(Distinct VisitID),PatientID))

Highlighted
Contributor III
Contributor III

Re: Average Number of Visits

Great thank you, 

Now I need to only count patients with Diagnosis=Mentalhealth 

 

Is this possible?

Highlighted
Contributor III
Contributor III

Re: Average Number of Visits

Use set analysis expression

count({<[Diagnosis]={'Mentalhealth'}>}PatientID)

Highlighted
Contributor III
Contributor III

Re: Average Number of Visits

Thank you - where would i put the VisitID?

Highlighted
MVP
MVP

Re: Average Number of Visits

Avg(Aggr(Count({<[Diagnosis]={'Mentalhealth'}>}Distinct VisitID),PatientID))

or

Avg({<[Diagnosis]={'Mentalhealth'}>}Aggr(Count({<[Diagnosis]={'Mentalhealth'}>}Distinct VisitID),PatientID))