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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

complex set analysis syntax-- combining conditions

need to combine these two statements:

=If(Aggr(NODISTINCT Min(DATE_OUTPT), PAT_MRN_ID) = DATE_OUTPT, 1, 2)

//this puts a 1 next to the minimum date for every Patient ID (PAT_MRN_ID) and a 2 next to the rest of them

AND

=COUNT(DISTINCT {$<[OUTPT_CALDENS] = {">20"}>} PAT_MRN_ID))

// this counts the number of distinct pat id's with CALDENS > 20

Every date has a Caldens associated and I need to combine these two so that I am counting every PAT_ID where the minimum date has a CALDENS>20.

Any help would be much appreicated!!!

I tried this and it doesn't work:

=If(Aggr(NODISTINCT Min(DATE_OUTPT), PAT_MRN_ID) = DATE_OUTPT,

COUNT(DISTINCT {$<[OUTPT_CALDENS] = {">20"}>} PAT_MRN_ID))

1 Reply
Anonymous
Not applicable
Author

Hi

Try this expression

=If(Aggr(NODISTINCT Min(DATE_OUTPT),PAT_MRN_ID)=DATE_OUTPT,1,2) AND If({$<[OUTPT_CALDENS]={">20"}>},Count(Distinct(PAT_MRN_ID))

Regards

Revathy