4 Replies Latest reply: Jun 15, 2012 4:37 AM by Revlin Abbi RSS

    Sum only grouped by one field?

      Hi all,

       

      Wondering if something is possible, to help explain I have set iut an example below.

       

      Say I have a straight table with 4 fields:

       

      year,

      quarter,

      month,

      quantity,

       

      I would like to add a 5th field which is an aggregate function but only grouped by the year, i.e. I want to add quanity_year which is the sum of quantity for the year. Can I do this using an expression?

       

      I have an example below:

       

      table

      year     quarter     month     quantity     year_quanity

      2011     1               1              3               14

      2011     2               .               5               14

      2011     3               .               6               14

      2012     1               .               8              

       

      Any suggestions? Thanks

       

      Regards,

       

      Revlin