Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
baylor2016
Creator
Creator

Can I do this using pure set analysis insteading using aggr function?

Hi,

I used this expression to get number of patients whose test value is more than 190. Can I use pure set analysis and count to get this number? If it can be done, I will be able to use union for more calculation.

=sum(

if (AGGR(

FirstSortedValue(

{<

YearMonth,

FLAG_DM={1},

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

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

            COMPONENT_ID= {5577,1557762,1578329},

            LABORDERDATE2 = {"$(='>=' & Date(V_selectedDate_1YearAgo) & '<=' & Date(V_selectedDate))"},

            LABRESULT={'*'}  

>}

LABRESULT, -CONTACT_DATE), PAT_ID

)>=190, 1,0)

)

Thanks

1 Reply
Anonymous
Not applicable

I don't think so..., because you calculate every firstsortedvalue() per PAT_ID

Perhaps you could do the calculation in script but then the calculation will be fixed....