• srinivas.akyana (1/23/2015)


    Hello ChrisM@Work,

    Since I wanted to repeat the original combination 4 times prior for MonthIDs of 307 & 309, I would need to first start with latest month which is 309. And, original combination of 309 does adds an entry for 307 as well that means, 307 will have two entries i.e, RSCID = 2345 (original) & RSCID = 3542.

    Once I am done with iteration for MonthID of 309 then I will need to the same process for MonthID of 307 as well. Since MonthID of 307 has two entries now, those two entries needs to be repeated for MonthIDs of 306, 305, 304 & 303.

    Please let me know if you need any further information from my side.

    Thanks in advance!

    Let's see if we can simplify this request a bit.

    Are you saying that you want to find the maximum MonthID for each and every RSCID and then ensure (generate if necessary) that there are exactly 4 months (original and 3 previous) for each RSCID?

    Your latest graphic seems to suggest that but I just want to make sure.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)