I am trying to start my week in fiscal calendar from Monday.It starts from Monday only for the current year but for the previous year it starts from Sunday.I want to start the week from Monday for all the years.
The following is in regard to fiscal year, but it may be of some help in getting you on the right track, it is a design blog post from Henric Cronstrom, hopefully it gets you a bit further on things. There are a bunch of other posts out there as well, so I would be sure to search further if this one does not get you exactly what you need, as there may be another with the additional detail you need...
To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question. I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Thanks for that link Brett. I ended up playing with that far too long, but was able to create something close. It needs some finagling to get it to work YoY but I did get it to set the start week to 1 on April 1st. Getting it to not count week 1 UNTIL Monday in the first week of the year is the next challenge. Otherwise it works okay.
/* Set date range for calendar */
LET vDateMin = Num(MakeDate(2015,4,1)); LET vDateMax = Floor(MonthEnd(Today())); LET vDateToday = Num(Today());
TempCalendar: LOAD Date($(vDateMin) + RowNo() - 1) AS TempDate AUTOGENERATE 1 WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);
/* HC's code, modified for vFW and fWeek below; */
Set vFM = 4 ; // First month of fiscal year Set vFW = 14 ; /* Added to get the First week of fiscal year, as close to April 1st as possible */
Calendar: Load TempDate as Date, /* date to join to other data */ WeekDay, /* To verify day of week when week starts */ Year + If(Month>=$(vFM), 1, 0) as fYear, // Numeric fiscal year Mod(Month-$(vFM), 12)+1 as fMonth, // Numeric fiscal month Mod(Week-$(vFW), 52)+1 as fWeek /* Added for the week. Not perfect but can be modified to get what you need */ ; Load TempDate, Year(TempDate) as Year, // Your standard master calendar Month(TempDate) as Month, Week(TempDate) as Week, WeekDay(TempDate) as WeekDay RESIDENT TempCalendar ORDER BY TempDate ASC;