Re: [GENERAL] How to distribute quantity if same product is in multiple rows

2010-07-23 Thread Andrus Moor
Tim, Thank you. It can be done in SQL: "SUM(kogus) OVER (PARTITION BY toode ORDER BY ID) - kogus" (*1) will give you the running sum of the product up to that row. You can then subtract that value from the delivered quantity to calculate the delivered quan- tity for the current row. I tried t

Re: [GENERAL] How to distribute quantity if same product is in multiple rows

2010-07-22 Thread Tim Landscheidt
(anonymous) wrote: >>It can be done in SQL: "SUM(kogus) OVER (PARTITION BY toode >>ORDER BY ID) - kogus" (*1) will give you the running sum of >>the product up to that row. You can then subtract that value >>from the delivered quantity to calculate the delivered quan- >>tity for the current row.

Re: [GENERAL] How to distribute quantity if same product is in multiple rows

2010-07-22 Thread Andrus
Tim, Thank you. It can be done in SQL: "SUM(kogus) OVER (PARTITION BY toode ORDER BY ID) - kogus" (*1) will give you the running sum of the product up to that row. You can then subtract that value from the delivered quantity to calculate the delivered quan- tity for the current row. But doi

Re: [GENERAL] How to distribute quantity if same product is in multiple rows

2010-07-20 Thread Tim Landscheidt
(anonymous) wrote: > Order contains same product in multiple rows. > I tried to calculate undelivered quantity using script below but it produces > wrong result: > delivered quantity is substracted from both rows, not distributed. > How to distibute undelivered quantity according to row quantity

[GENERAL] How to distribute quantity if same product is in multiple rows

2010-07-17 Thread Andrus
Order contains same product in multiple rows. I tried to calculate undelivered quantity using script below but it produces wrong result: delivered quantity is substracted from both rows, not distributed. How to distibute undelivered quantity according to row quantity in every row ? Can it be done