Inserting calculated fields in a matrix?

  • I have a matrix that shows sales per customer for this year-to-date and sales for last year-to-date. I would like to add a column showing the variance. I know how to do this using a table control, but a matrix doesn't seem to allow it. The dataset returns data as...

    Year   Period   Customer     Sales   

    2006     1           2310        100.21

    2006     4           2310          99.45

    2005     1           2310        743.18

    2006     1           4420        3324.32

    2005     2           2310        111.00

    2006     3           4420        848.23

    The report shows...

                     2005       2006

     Customer           Sales  

    ---------   --------  ---------

    #2310         xxxx.xx    xxxx.xx

    #4420         xxxx.xx    xxxx.xx

    Can you add a column to the right that shows the variance? Thanks!

     

     


    smv929

  • One option is to add the variance as a calculated column in your dataset. 

  • You can add a column to the matrix and then modify the expression to put in a calculated field. The calculated field can use the sum function as shown below. This might work for you.

     

    =IIF(Sum(Fields!Count.Value) > 0 ,Format( Sum(Fields!Sales.Value) / Sum(Fields!Count.Value),"##%"),"")

     

    Stuart

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply