Matching financial periods to dates
It would be a wonderful world if all companies had their financial year starting on the 1st of January, and each financial period matched to a calendar month. But that isn't the case, and companies often start their year on different dates and have different financial periods across their year.
In this recipe, we will look at a company that uses periods based on weeks that do not exactly match to months. We have a table that defines the start and end of each period, and we need to map that to our calendar.
Getting ready
Load the following script:
PeriodTable: LOAD * INLINE [ PeriodNumber, PeriodStart, PeriodEnd 1, 2013-01-01, 2013-01-27 2, 2013-01-28, 2013-02-24 3, 2013-02-25, 2013-03-31 4, 2013-04-01, 2013-04-28 5, 2013-04-29, 2013-05-26 6, 2013-05-27, 2013-06-30 7, 2013-07-01, 2013-07-28 8, 2013-07-29, 2013-08-25 9, 2013-08-26, 2013-09-29 10, 2013-09-30, 2013-10-27 11, 2013-10-28, 2013-11-24 12, 2013-11-25, 2013-12-31 ]; Calendar...