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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count if two conditions

Hi everyone,

      could you help me with an expression i need to write?

i have to count(distinct (subscriptions.email)) but if (count(deal_externals.deal_external_id)) > 1, and if subscriptions.email = users.email

Example

deal_external_id
subscription.email
users.email
Header 4
1john@hotmail.com-
2lara@gmail.comlara@gmail.com
3peter@hotmail.competer@hotmail.com
4lara@gmail.comlara@gmail.com

so, the value of the expression should be 1.

I don't know even if the experssion (count(deal_externals.deal_external_id)) > 1 is wright, i need to count how many deal_external_id has some user.

Example:

deal_external_iduser
1566
2555
3566

user 566 has two deal_external_id

user 555 has one deal_external_id

thanks for any advice

Gerardo

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try this

     Sum(Aggr(if(count(deal_externals.deal_external_id)) > 1 and subscriptions.email = users.email,1,0),subscriptions.email,users.email))

Celambarasan

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try this

     Sum(Aggr(if(count(deal_externals.deal_external_id)) > 1 and subscriptions.email = users.email,1,0),subscriptions.email,users.email))

Celambarasan

Not applicable
Author

thanks Celambarasan!