find the difference between two columns in an ssrs matrix

  • I have the following ssrs matrix that I am building :

    Jan Feb March

    Sales 10 3 9

    What I would like to do now is to find the difference between each of the rows to show something like :

    Jan Feb March

    Sales 10 3 9

    #change -7 6

    In an ssrs table its a simple expression .

    I do not know how I need to do it in a matrix since the Months Columns are generated dynamically

    Please direct me..

  • Ok, probably i've got a solution:

    1) Write this Custom Code and add it to your Report:

    Private previousValue As Integer = 0

    Public Function GetPreviousValue(ByVal runningValue) As Integer

    Dim temp As Integer = previousValue

    previousValue = runningValue

    Return temp

    End Function

    2) Add a Row, inside RowGroup of your Matrix and set th expression of the textbox as:

    =<FiledWithYourValueInMatrix> - Code.GetPreviousValue(<FiledWithYourValueInMatrix>)

    Remember that you have to change the value for <FiledWithYourValueInMatrix>

    Let me know if it works! 🙂

  • Take a look at the attachment

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

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