7 Replies Latest reply: Apr 20, 2017 4:56 AM by Sunny Talwar RSS

    How to subtract the Average of each group from latest value?

    Mohan Kumar

      Hi,

       

      I am trying to calculate the average sales amount of each group and this is subtracted from the latest bill amount. Like I showed below in the image,

      Capture.JPG

      I tried in many ways to get the answer but I got the wrong answers. I used the following expression.

      Aggr(avg(NETAMT),CUSTOMER)

      Aggr(avg(sum(NETAMT)),CUSTOMER)

      Avg(Aggr(sum(NETAMT),CUSTOMER))