3 Replies Latest reply: Apr 1, 2016 2:19 AM by kushal chawda RSS

    Aggregation question I think?



      I am trying to work out how to refer to a all records for a field instead of the components.


      As an example I have records similar to this


      Customer          Sales

      A                         500

      A                         423    

      B                         150

      C                         200

      A                         400

      B                         100

      B                         120

      C                         130

      D                         500


      what I want to do is work out the difference between the average sales for one customer against the fractile of the total data set. As an example


      avg(Sales) - fractile(Sales,0.5)


      The issues is that I want the fractile of all the sales for the total data set not for that customer. How would I structure this expression?


      Thanks in advance