2 Replies Latest reply: Jun 27, 2017 8:57 AM by benjamin raquin RSS

    Count occurrences

    benjamin raquin

      Hello,

       

      I have a little problem with a counting function.

       

      I try to count the number of customers but only when the number of recorded actions is greater than 2 and the place = 'x'

       

      CustomerplaceActions
      A

      x

      f
      Axg
      Axh
      Azi
      Bxf
      Bxg
      Bxh
      Czk
      Czl
      Cxi
      Dxj

       

      in the the table above I would like to count the number of customers where:

      - place different from x

      - number of actions is greater than 2

      So here the result should be 2.

       

      My problem is that I know how to count with conditions

       

      count(distinct if(

           place = 'x',

      , Customer) )

       

      but I cannot add a calculation as a condition.