• Talvin Singh - Thursday, February 15, 2018 2:00 PM

    Luis Cazares - Thursday, February 15, 2018 1:52 PM

    Similar but I need the basket ID to restart. I have played around with that code but not getting it to work

    There is nothing in your table to guarantee the processing order within an ID.  Without such a thing, this is doomed to failure.

    If the goal is to process in order by both the ascending order of both the ID and the Value, then such a thing can be done quite easily but if you're trying for something like load balancing, then that won't work.

    What is this for?  Load Balancing?  Packing Boxes/Bins? Assigning tasks by duration?  What?

    --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)