Matrix subtotal and average

Hi,

I am trying to customize a matrix subtotal. Here is the matrix I am trying to design:

Product 2001 2002 2003
product1 Total amount 10 15 20
Total weight 2 5 2
Average price/weight 5 3 10
product2 Total amount 5 36 60
Total weight 2 6 6
Average price/weight 2.5 6 10
Total Total amount 15 51 80
Total weight 4 11 8
Average price/weight 5 3 10

Each "average price/weight" for each product is simply the total amount divided by the total weight. The matrix work as expected for each product/year section. It also almost do what I want except for "Average price/weight". The matrix is setting the Average price/weight to the value of the first product. Is there a way to customize this subtotal line For example, I would need to calculate the Average price/weight for 2001 as follow:

Total amount / Total Weight

=

15/4= 3.75

Is this possible with a matrix

Thank you,

Sylvain



Answer this question

Matrix subtotal and average

  • Jonathan Shields

    You are right! I was using Fields!Amount.Value/Fields!Weight.Value. I tried your suggestion and it worked perfectly! Thanks a lot!
  • shlomim

    What's the expression you are using in the average cell If it's Fields!Amount.Value/Fields!Weight.Value, it'd return you the value for the first product. You can try changing it to Sum(Fields!Amount.Value)/Sum(Fields!Weight.Value).

  • Matrix subtotal and average