2 Replies Latest reply: Apr 25, 2012 2:05 PM by gerardo.pauza RSS

    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