Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
graham-crooks
Contributor III
Contributor III

Ignoring a dimension value in an aggregated chart (akin to 'having' clause?)

To keep the explanation as simple as possible, I’ll describe it thus: I’m counting the number of times patients are admitted to a hospital.Hence:-

Dimension:

=aggr(sum({<set analysis in here>}AdmCounter),PatientID)

Expression:

count({<set analysis in here>}distinct PatientID)

And I get a very nice chart thankyou...

MultipleAdmitChart.png


However, for this example, I’m really not interested in the “1” column but I want all the others (akin to a sql “Having Count >=2” clause I guess). How can the “1” column be ignored please?  What do I write? Where do I put it? Any help very much appreciated.

2 Replies
swuehl
MVP
MVP

Either try:

=aggr(if(sum({<set analysis in here>}AdmCounter)>1,

sum({<set analysis in here>}AdmCounter))

,PatientID)

or

if(sum({<set analysis in here>}AdmCounter)>1,

count({<set analysis in here>}distinct PatientID) )

Hope this helps,

Stefan

graham-crooks
Contributor III
Contributor III
Author

Thanks Stefan. The first of the two suggestions appears to be the correct solution and works just fine:

=aggr(if(sum({<set analysis in here>}AdmCounter)>1,

sum({<set analysis in here>}AdmCounter))

,PatientID)

Many thanks.

Graham