7 Replies Latest reply: Oct 17, 2016 6:04 AM by Hamid Kashefipour RSS

    Sum(Aggr(sum()) or Aggr(Sum(),Key)

      Hi everyone

       

      In my table :

       

      CNumber     Amount

      1                    100

      1                    100

      2                    200

      3                    300

      4                    400

      5                    500

      5                    500

       

       

      CNumber is my primary key. At times I have amount repeating twice in front of it.

       

      I want a sum of the amount in a way that duplicate entry is not considered,

       

      For example Sum of 1 should be 100 and sum of 5 should be 500.

      But i keep getting 200 and 1000 in stead.

      I tried using Sum(aggr(Sum(Amont),CNumber)) and Aggr(Sum(Amount),CNumber)

       

      I am still unable to obtain the desired result.

      Please help

       

      Thanks,

      Utsav