19 Replies Latest reply: May 21, 2017 7:38 AM by kushal chawda RSS

    Distinct Count

    Ahmad Abdolkhalegh

      Hi all

       

      i write an expression for counting distinct customers who bought from us with two condition:

      1)  at least they bought 1 product from us

      2) our sales to them minus sales returns be greater than zero

       

      so i write this:

       

      sum(aggr(DISTINCT(if((sum(SalesQTY*Price)>0) and ((sum(SalesQTY*Price)-sum(SalesReturnsQTY*Price))>0,1,0)),Customer's ID))

       

      i used Date (YY-MM) as dimension but it shows me "No data to display"!

       

      is my formula right?

       

      tnx in advance