Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count occurrences

Hello.

I have two tables called DONOR (key DONOR_ID) and DONATION (DONATION_ID). They are connected via DONOR_ID.

Now I want to count how many Donors(uniqe DONOR_ID) that have exactly 2 donations(DONATION_ID).

How do i achieve this?

Regards

Databyran

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Sounds like you should be able to do something like this:

sum(aggr(if(Count(DONATION_ID)=2,1,0),DONOR_ID))

Count all instance where the number of donation-id's = 2, for every  Donor_id and assign them the value 1. Then sum up these ones into the total count.

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Sounds like you should be able to do something like this:

sum(aggr(if(Count(DONATION_ID)=2,1,0),DONOR_ID))

Count all instance where the number of donation-id's = 2, for every  Donor_id and assign them the value 1. Then sum up these ones into the total count.

Not applicable
Author

Thank you, worked perfect!

Please have a look at this post - maybe you have a solution?

http://community.qlik.com/message/236513#236513

Thank you!

Databyran