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: 
JacobLag
Contributor
Contributor

Aggr() Function - Multiple Conditions

Hello everybody,

I want to create a new table using the aggr().

Simple example (in reality there are much more data)

Patient

Country

100

A

100

B

200

A

200

B

300

A

300

...

400

B

400

...

 

How, do I create a table, which shows me only the Patients which have lived in Country A, but never in Country C?

First Step in order to get the patients who have lived in A:

Count(Aggr(Count({<Country={"A"}>} Patient), Patient))

Second Step to exclude Country B?

Do yuo have any ideas for me :)?

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be this

Count({<Patient = p({<Country = {'A'}>})-p({<Country = {'C'}>})>} Patient)

or

Count({<Patient = p({<Country = {'A'}>})*e({<Country = {'C'}>})>} Patient)

 

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

May be this

Count({<Patient = p({<Country = {'A'}>})-p({<Country = {'C'}>})>} Patient)

or

Count({<Patient = p({<Country = {'A'}>})*e({<Country = {'C'}>})>} Patient)

 

JacobLag
Contributor
Contributor
Author

Thank you very much 🙂 it worked! I'm so happy