0 Replies Latest reply: Jun 13, 2013 7:59 PM by user8742475 RSS

    How to sum from 2 fields?


      Here's my xml






      I want to sum the total sale prices, in this case it will be $14.00 because the 1st one does not sell any ticket


      One more thing, the <sold></sold> tag will only have 2 values (1 or 0)


      The simplest way I think of is to multiple price with sold for each ticket and then sum it all up.


      I group by <ticket> and below is my code but I got 0


      <?sum(current-group()/sold * current-group()/price)?>


      Do you know why? If you have a simpler approach, please let me know