I have a script that creates a table showing the static quantity of a product in stock during a "from date" to a "to date", it looks like this:
Product
FromDate
ToDate
Quantity
1
2021-06-08
2021-10-14
20
1
2021-10-15
2021-11-10
25
1
2021-11-11
2022-02-04
27
1
2022-02-05
2022-02-23
4
But I need the script to add rows with year/month that fit into the range of each "FromDate" to "ToDate", still with the same stock quantity. And i also need a new column "QD" that shows the total of days in each month the product have been in stock, see example below. Is this possible to do?