A lot of company is using 4 week + 4 week + 5 week period pattern instead of using a calendar month, so the 12 calendar months will be regrouped into 12 periods.
|Period 1||4 Weeks|
|Period 2||4 Weeks|
|Period 3||5 Weeks|
|Period 4||4 Weeks|
|Period 5||4 Weeks|
|Period 6||5 Weeks|
|Period 7||4 Weeks|
|Period 8||4 Weeks|
|Period 9||5 Weeks|
|Period 10||4 Weeks|
|Period 11||4 Weeks|
|Period 12||5 Weeks|
There are some special conditions for Period 1 and Period 12
If the first week of the year is less than 3 days, this partial week plus the second week of the year will be considered a whole week,
for an example, the first week of 2016 contains only 2 days, so the first week of period 1 2016 has 9 days. and Period 1 is ending on Jan 30th.
another condition is Period 12 is always ended on Dec 31, no matter whether the last week of the year is a partial week.
My code had covered these two conditions when applying the code, you need to add a section called master calendar in data load editor , and then copy and paste the code to the section.
Next, find the code below from the very top of the code and change the field name " Date" to your field name of date.
Min("Date") as MinDate,
Max("Date") as MaxDate
Click Load Data, you should get a calendar table with 12 Periods and all the calendar weeks are also classified into 445 week numbers.
such as Period 1 Week 1, Period 3 Week 5, etc. Note: only Period 3, 6, 9 ,12 have week 5.
There are also a lot of fields other than Period in the calendar table for you to use, please check your table viewer for details.
All comments and suggestions are welcomed, please send me message or emails.