Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
---|---|---|---|
1 | john@hotmail.com | - | |
2 | lara@gmail.com | lara@gmail.com | |
3 | peter@hotmail.com | peter@hotmail.com | |
4 | lara@gmail.com | lara@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_id | user |
---|---|
1 | 566 |
2 | 555 |
3 | 566 |
user 566 has two deal_external_id
user 555 has one deal_external_id
thanks for any advice
Gerardo
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
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
thanks Celambarasan!