Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor

How do I find the number of patients with 2 or more visits in a given year?

My fields are Year, Visits, Mbr_Id, Provider

So, I need to show how many members by Provider had 2 or more visits.  I don't even know where to start.

If visits >= 2 ,count(distinct(Mbr_Id)) but I am not sure how to determine  if a mbr had more than one visit.  Is there anyone that can help?

5 Replies
Specialist III
Specialist III

Well, maybe this will help you:

Aggr (Count ({<Visits={">=2"}>}Distinct Mbr_Id),Provider)

Cheers

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
Master II
Master II

Hi,

let say user selected as Year 2018 then

Dimension:

Provider

Measure:

count (distinct  {$<Year={"$(=Max(Year))"},Visits={">=2"}>} Mbr_Id)


if still has issue, can you your mock data and expected output. tks


Thanks

Deva


Master
Master

//if(count(Visit)>'2',Count(Mbr_Id),'NA')

Count(distinct {<Visit = {">=2"}>}Mbr_Id)

May be this

Count(DISTINCT {<Mbr_Id = {"=Count(DISTINCT Visit) >= 2"}>} Mbr_Id)

Contributor
Contributor

This is working, but is it possible to replace the =Max(Year) with a variable $(vPriorYr) and the Visits with another variable $(Visits)