Hello there,
I have the following problem to solve (really hard one), i have a list of row (> then 100) that have this kind of pattern:
| N° | Order | Sub_order | Material | Description | Material_2 | Valute to withdraw_quote | Material description | Qty to be picked_quote | Date_withdrawal_quote | Material Doc. | Date_withdrawal | Qty_withdrawn | Delta | Value_withdrawal |
| 1 | Project1 | 2306394 | G11220AB004 | A | 268W725E01 | 281.183,40 € | Material a | 54 | 02/05/2021 | 4900626134 | 20/04/2021 | -2 | 52 | 10.414,20 € |
| 2 | Project2 | P1572067 | G11220AB003 | B | 268W725E01 | 281.183,40 € | Material a | 54 | 11/08/2021 | | | 0 | 54 | - € |
| 3 | Project1 | 2306394 | G11220AB004 | A | 268W725E01 | 281.183,40 € | Material a | 54 | 02/05/2021 | 4900636338 | 05/05/2021 | -53 | 1 | 275.976,30 € |
Now, i need to update this table with the following logic:
1) sort all rows by ascending Date_withdrawal value (this should be a simple sort) then:
2) Check row 1 and compare it with all the sheet:
if you find a row that have both the same values (for example line 3)
- Valute to withdraw_quote >> Set to 0 the lowest row
- Qty to be picked_quote >> should be reduced by the qty that have been withdrawn (54-2=52)
the result should be something like:
| N° | Order | Sub_order | Material | Description | Material_2 | Valute to withdraw_quote | Material description | Qty to be picked_quote | Date_withdrawal_quote | Material Doc. | Date_withdrawal | Qty_withdrawn | Delta | Value_withdrawal |
| 1 | Project1 | 2306394 | G11220AB004 | A | 268W725E01 | 281.183,40 € | Material a | 54 | 02/05/2021 | 4900626134 | 20/04/2021 | -2 | 52 | 10.414,20 € |
| 2 | Project2 | P1572067 | G11220AB003 | B | 268W725E01 | 281.183,40 € | Material a | 54 | 11/08/2021 | | | 0 | 54 | - € |
| 3 | Project1 | 2306394 | G11220AB004 | A | 268W725E01 | 0€ | Material a | 52 | 02/05/2021 | 4900636338 | 05/05/2021 | -53 | 1 | it will be updated later |
this logic should work also with an hypothetical 4th row. in that case the system should use the same logic but it should consider the fact that 3 withdrawal have been made
can someone help me?
many thanks!