I need help calculating the stock amount of each product at the end of every month.
i’ve got a list of specific SKUs and its initial stock count at the beginning of the year, and another list grouping the sales amount.
The goal is to reduce the sales amount from the initial stock count and so on
here i’ve got the initial stock values at the beginning of the year (column estoqye)
and in this table i’ve got the sales amount of each month for each product id.
thx very much guys
You could join your two tables by SKU and year so that the stock at the beginning of the year is present in every monthly row. You can use a Group Loop Start + Loop End to go through every product and year individually. Now inside the loop, you can use a Moving Aggregation node with cumulative sum aggregation on the sales amount column and subtract this cumulative sum from the stock at the beginning of the year. So something like this:
Group Loop Start (group by SKU and year) -> Sort by month -> Moving aggregation -> Math Formula -> Loop End
thx man, it worked perfectly
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.