Logical Problem -> Recursion?

  • Hello all,

    i'm trying to find a solution for the following problem, maybe recursion is an answer.

    I have the Ordertable where the order amount per customer ist stored.

    I have the ShippedTable where the actual shipped amount is stored

    OrderTable

    Priority | Customer | OrderQuantity

    1 | A | 3

    2 | B | 2

    ShippedTable

    ShippedQuantity | ShippedDate

    4 | 20110114

    1 | 20110121

    Now i want to allocate the Shipped quantity to the orders according to priority flag.

    On 20110114 the Final table should look like this:

    FinalTable

    Customer | Shipped quantity | Shipped Date

    A | 3 | 20110114

    B | 1 | 20110114

    On 20110121 the Final table should look like this:

    FinalTable

    Customer | Shipped quantity | Shipped Date

    A | 3 | 20110114

    B | 1 | 20110114

    B | 1 | 20110121

    Any help or ideas would be much appreciated!

  • I'm not fully understand the business case:

    You shipped a quantity X on a given day to more than one customer. Wouldn't you need to know the address of each customer to ship a specific quantity?

    Shouldn't your desired result table already be there?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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