Hi!
I’m trying a “simple” calculation since days, it’s frustrating, maybe someone can give me a hint.
I want to simulate inventory movements: subtract orders from inventory.
But I really don’t know how to handle it, since at the start point (first row) EM has to fetch the “real” stock amount, but after the second entry it has to regard the virtually calculated new stock.
I tried merging, iterating, calling, aggregating …
Example 1st table (orders):
| order no. | item | amount |
| 1 | ABC | 10 |
| 2 | DEF | 5 |
| 2 | ABC | 5 |
| 3 | DEF | 15 |
Example 2nd table (“real” stock):
| item | stock |
| ABC | 100 |
| DEF | 100 |
Goal:
| order no. | item | amount | stock |
| 1 | ABC | 10 | 90 (100-10) |
| 2 | DEF | 5 | 95 (100-5) |
| 2 | ABC | 5 | 85 (90-5) |
| 3 | DEF | 15 | 80 (95-15) |
Many thanks in advance!!
Regards, Michael