help with calculating difference in ssrs

  • i have the foll scenario:

    col1 col2 col3 col4

    A 1 100

    2 250 150

    3 500 250

    4 600 100

    5 900 300

    For col4 i need to calculate the difference b/w (the value in current row in col3 i.e. 250) - (the value in the previous row in col 3 i.e.100). i need to do that for all rows of col4. Can anyone help me do this in ssrs?

  • I assume you mean how do you do this in Report Builder?

    And you are needing help with how to write an expression for column 4 to give the results as exampled by your sample output?

    If you insist on doing it in an expression look at the function "RunningValue", but I'd recommend doing the calculation in sql using windowing functions or quirky update.

    Check this out -

    http://www.sqlservercentral.com/articles/T-SQL/68467/

  • i know about the running value function but not sure how i can use it here.

    can you elaborate on how i can use running value function here?

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

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