Hi All,
I have data set that I need to take the number based on the month.
EX: if the current month is June'23 then I need a data from Octo'22 to Mar23 and Data should always start from the Oct month. if the new year starts (jan24) then Data should capture for the Octo23 month(Rolling back 3month)
Below is the data set
| Data Set |
| Date | Sale | Sales Persons |
| 10-01-2022 | 45388 | 14 |
| 11-01-2022 | 23525 | 36 |
| 12-01-2022 | 30649 | 93 |
| 01-01-2023 | 59313 | 11 |
| 02-01-2023 | 34740 | 75 |
| 03-01-2023 | 49074 | 16 |
| 04-01-2023 | 55092 | 74 |
| 05-01-2023 | 66040 | 11 |
| 06-01-2023 | 52715 | 25 |
| 07-01-2023 | 47802 | 51 |
| 08-01-2023 | 58830 | 28 |
| 09-01-2023 | 63401 | 89 |
| 10-01-2023 | 25486 | 61 |
| 11-01-2023 | 24919 | 59 |
| 12-01-2023 | 56097 | 49 |
| 01-01-2024 | 23690 | 79 |
| 02-01-2024 | 53479 | 32 |
| 03-01-2024 | 33066 | 50 |
| 04-01-2024 | 92851 | 66 |
| 05-01-2024 | 86198 | 78 |
| 06-01-2024 | 83199 | 88 |
| 07-01-2024 | 36539 | 34 |
| 08-01-2024 | 37064 | 51 |
| 09-01-2024 | 24919 | 50 |
| 10-01-2024 | 56097 | 66 |
| 11-01-2024 | 23690 | 78 |
| 12-01-2024 | 53479 | 88 |
Result that I need
| Data Set | Result |
| Date | Sale | Sales Persons | Current Period | Avg Headcount |
| 10-01-2022 | 45388 | 14 | | |
| 11-01-2022 | 23525 | 36 | | |
| 12-01-2022 | 30649 | 93 | | |
| 01-01-2023 | 59313 | 11 | | |
| 02-01-2023 | 34740 | 75 | | |
| 03-01-2023 | 49074 | 16 | | |
| 04-01-2023 | 55092 | 74 | | |
| 05-01-2023 | 66040 | 11 | | AVERAGE(Oct'22 to Mar23) |
| 06-01-2023 | 52715 | 25 | 52715 | 40.83333333 |
| 07-01-2023 | 47802 | 51 | | |
| 08-01-2023 | 58830 | 28 | | |
| 09-01-2023 | 63401 | 89 | | |
| 10-01-2023 | 25486 | 61 | | |
| 11-01-2023 | 24919 | 59 | | |
| 12-01-2023 | 56097 | 49 | | AVERAGE(Oct'23) |
| 01-01-2024 | 23690 | 79 | 23690 | 61 |
| 02-01-2024 | 53479 | 32 | | |
| 03-01-2024 | 33066 | 50 | | |
| 04-01-2024 | 92851 | 66 | | |
| 05-01-2024 | 86198 | 78 | | |
| 06-01-2024 | 83199 | 88 | | |
| 07-01-2024 | 36539 | 34 | | |
| 08-01-2024 | 37064 | 51 | | |
| 09-01-2024 | 24919 | 50 | | |
| 10-01-2024 | 56097 | 66 | | |
| 11-01-2024 | 23690 | 78 | | |
| 12-01-2024 | 53479 | 88 | | |
Thank you