I have a table with different product and dates. Each product has an expected lead time from the time that it gets produced to the time that it gets approved for sale. I would like to capture the expected "approved" items by day, something like in the following table.
day | product | produced quantity | Expected approval Lead time (days) | approved quantity |
---|---|---|---|---|
1 | A | 20 | 2 | 0 |
2 | A | 22 | 2 | 0 |
3 | A | 23 | 1 | 20 |
4 | A | 19 | 1 | 45 |
5 | A | 15 | 1 | 19 |
next period | A | - | - | 15 |
1 | B | 5 | 1 | 0 |
2 | B | 3 | 1 | 5 |
3 | B | 3 | 2 | 3 |
4 | B | 12 | 1 | 0 |
5 | B | 8 | 2 | 15 |
next period | B | - | - | 8 |
I tried looking for something similar here in stackoverflow and online, but could not find anything.