15 Replies Latest reply: Sep 7, 2012 5:42 AM by Martina Brenner RSS

    Sum of only certain values

    Luca Jonathan Panetta

      Hi!

       

      Excuse me for the title of the post, but I don't know how to summarize my problem.

       

      Basically, I have a table such this one:

       

      OrderValueAValueB
      11013
      21212
      31510
      41918
      51116

       

      Where ValueA and ValueB are calculated values (using expressions).

       

      I need to make the following computations:

      1. Calculate the SUM of the difference for the rows where ValueB is grater than ValueA, in this case (13-10)+(16-11) = 8
      2. Calculate the SUM of the difference for the rows where ValueA is grater than ValueB, in this case (15-10)+(19-18) = 6

       

       

      In conclusion, I need to create two Text fields, one containing the value 8 and one with 6.

       

      Is it possible?