Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
baylor2016
Creator
Creator

Set analysis question

Hi,

I would like to get the number of patients who visited FCM clinics (4 patients) and had a1c tested this year, no matter whether it is done (it should be 4). I can only get 2 by using the script below.

=count(distinct {

<FCMVisit={1},

A1cThisYear={1}

>} PAT_ID)

How to get the correct number? Sample attached. Thanks

     

VisitIDPAT_IDFCMVisitA1CA1cThisYear
111101
21150
32091
42081
53060
63081
73150
84150
94151
105081
1151100
Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Maybe

=count(distinct {

<

PAT_ID = p({<FCMVisit={1}>})*p({<A1cThisYear={1}>})

>} PAT_ID)

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Maybe

=count(distinct {

<

PAT_ID = p({<FCMVisit={1}>})*p({<A1cThisYear={1}>})

>} PAT_ID)

baylor2016
Creator
Creator
Author

When I apply your logic to my project, it did not work.  The first one returns 2613. The second one returns only 859. I thought these two are the same. Please advise. Thanks

=count(distinct {

<

YearMonth,

FCMVISIT={1},

VISITTYPE={'Office visit'},

APPT_STATUS_C={2},

CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},

FLAG_DM={1},

ENCOUNTERAGE ={"$(='>=18<=75)"},

PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18 and

            Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) <= 75"}

           

>

} PAT_ID)

---------------------------------------------------------------------------------------------------------------------------------------------------

=count(distinct

{<

PAT_ID=p({<

YearMonth,

FCMVISIT={1},

VISITTYPE={'Office visit'},

APPT_STATUS_C={2},

CONTACT_DATE2 = {"$(='>=' & Date(V_selectedDate_3YearAgo) & '<=' & Date(V_selectedDate))"},

FLAG_DM={1},

ENCOUNTERAGE ={"$(='>=18<=75)"},

PAT_ID = {"=Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) >= 18 and

            Age(Num(V_selectedDate), Only({<YearMonth>}BIRTH_DATE)) <= 75"}

>})

>}

PAT_ID

)