Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
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
1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe

=count(distinct {

<

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

>} PAT_ID)

View solution in original post

2 Replies
swuehl
MVP
MVP

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

)