Hello,
I have the next situation.
I need to calculate a revenue for the December which are an average for the last three months.
The exact situation.
| KP | Date | Amounts |
| Revenue | 2019-09-01 | 11112 |
| Revenue | 2019-10-01 | 1125 |
| Revenue | 2019-11-01 | 2563 |
The revenue for December will be AVG(amounts).
Then I want to save this value in DB and I will have the next value in a table.
| KP | Date | Amounts |
| Revenue | 2019-09-01 | 11112 |
| Revenue | 2019-10-01 | 1125 |
| Revenue | 2019-11-01 | 2563 |
| Revenue | 2019-12-01 | 4933 |
Then the revenue for January will be avg for the last three months and the avg will be save in db.
How to do this in for one year?