hello,
i have a dataset as below which for some products is missing dates. i want to make sure i have every missing month in there and make the sales figure the average of the previous 2 months.
this is what data looks like currently.
Product | Sales | current |
a | 1 | 01/09/2019 |
a | 2 | 01/10/2019 |
a | 3 | 01/11/2019 |
a | 4 | 01/03/2020 |
a | 5 | 01/04/2020 |
a | 2 | 01/05/2020 |
a | 2 | 01/06/2020 |
This is what i need it to be...
Product | Sales | needs to be |
a | 1 | 01/09/2019 |
a | 2 | 01/10/2019 |
a | 3 | 01/11/2019 |
a | average of prev 2 | 01/12/2019 |
a | average of prev 2 | 01/01/2020 |
a | average of prev 2 | 01/02/2020 |
a | 4 | 01/03/2020 |
a | 5 | 01/04/2020 |
a | 2 | 01/05/2020 |
a | 2 | 01/06/2020 |
Solucionado! Ir para Solução.
thanks. just realised when i run it for more than one products it doesn't seem to do it. some products will have every month in there already, could that be why?