Hello Alteryx Community,
I'm trying to figure out how much demand there would be remaining for a style after I replenish it. My challenge is the lead time to replenish varies from style to style. If it were all fixed, i'd filter my data set and summarize the forecast for weeks after the current week + weeks to replenish, but how to I calculate each style separately? Would it be a batch macro?
Example of data below:
Week | Style End Week | Style | Forecast | Weeks to Replenish | Demand after Replenishment |
1 | 7 | Apple | 10 | 3 | 20 |
2 | 7 | Apple | 2 | 3 | 18 |
3 | 7 | Apple | 3 | 3 | 12 |
4 | 7 | Apple | 2 | 3 | 2 |
5 | 7 | Apple | 6 | 3 | 0 |
6 | 7 | Apple | 10 | 3 | 0 |
7 | 7 | Apple | 2 | 3 | 0 |
1 | 7 | Orange | 8 | 4 | 19 |
2 | 7 | Orange | 7 | 4 | 11 |
3 | 7 | Orange | 8 | 4 | 9 |
4 | 7 | Orange | 4 | 4 | 0 |
5 | 7 | Orange | 8 | 4 | 0 |
6 | 7 | Orange | 2 | 4 | 0 |
7 | 7 | Orange | 9 | 4 | 0 |
How would I calculate this? Am I on the right track?
Cheers
Solved! Go to Solution.
Figured it out! Iterative macro to calculate the remaining demand for a single row. Then nest that iterative macro in a batch macro grouping by style.