SSRS Next/Previous Functon Fetch

  • Is Any Function in SSRS Report Like Crystal Report, we can find the next record column data and compare with current records? Suppose we have 4 records as mentioned below-

    ID    NAME PRODUCT
    1          A         P1
    1          A         P2
    2          B         P6
    2          B         P5
    3          C         P9

    I set all fields in Tablix detail section alongwith i created a group on ID field, now i wants print out of report like this

    ID    NAME PRODUCT
    1          A           P1
                              P2
    2          B           P6
                              P5
    3          C           P9

    Means i dont wants to repeat un-necessary common data. Can you help me, how this is possible in SSRS.

  • It took me less than a minute to open up SSRS, go to the Expression Builder, and look under "Common Functions" to find the answer.  This isn't rocket science.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • I don't think there's a way to do this in SSRS without gathering previous values in your data set.   With that in mind, using LAG in your query could handle getting the previous values, and then the comparison can be used to control "visibility" for the text boxes for which you need this to be true.   Obviously, you'll need to handle NULL values coming from the use of LAG, which will occur on the first row for certain, and depending on your query, possibly the first row of each group.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • drew.allen - Monday, July 30, 2018 10:09 AM

    It took me less than a minute to open up SSRS, go to the Expression Builder, and look under "Common Functions" to find the answer.  This isn't rocket science.

    Drew

    I know, It is not any Rocket science. but i did not get any function in SSRS, so i put this question here. if you took less than a minute then let me know.

  • sgmunson - Monday, July 30, 2018 10:10 AM

    I don't think there's a way to do this in SSRS without gathering previous values in your data set.   With that in mind, using LAG in your query could handle getting the previous values, and then the comparison can be used to control "visibility" for the text boxes for which you need this to be true.   Obviously, you'll need to handle NULL values coming from the use of LAG, which will occur on the first row for certain, and depending on your query, possibly the first row of each group.

    Okey, i guess i will do now after your suggestion.... Thanks Let me check

  • Gaurav Srivastava - Monday, July 30, 2018 10:35 AM

    drew.allen - Monday, July 30, 2018 10:09 AM

    It took me less than a minute to open up SSRS, go to the Expression Builder, and look under "Common Functions" to find the answer.  This isn't rocket science.

    Drew

    I know, It is not any Rocket science. but i did not get any function in SSRS, so i put this question here. if you took less than a minute then let me know.

    There is an old saying, "Give a man a fish and he eats for a day.  Teach a man to fish and he eats for a lifetime."  In that vein, I think it's far more valuable for you to learn how to find this for yourself than it is for me to just tell you.

    If you "did not get any function in SSRS" when you opened the Expression Builder, then there is a problem with your install and you need to reinstall.

    If you didn't find it under "Common Functions", it's because I purposely left incomplete instructions to encourage you to figure things out for yourself.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 6 posts - 1 through 5 (of 5 total)

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