
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Weeks not working?
I have created weeks as follows:
vCal_FD = 0;
SET vCal_BW = 0;
SET vCal_RD = 4;
(DateValue-WeekStart((Date(YearStart(If($(vCal_BW), DateValue, (Date( WeekStart( DateValue, 1, $(vCal_FD)) - $(vCal_RD))))) + $(vCal_RD) - 1)), 0, $(vCal_FD)) + 7, 7) AS WeekNumber,
Problem is, I am getting strange results with week 53.
2015, week 53 = 28/12/2015 - 31/12/2015
2016, week 53 = 1/01/2016 - 3/01/2016
2016, week 1 = 4/01/2016 - 10/01/2016
How can I make the dates run in the following order?
2015, week 53 = 28/12/2015 - 3/01/2015
2016, week 1 = 4/01/2016 - 10/01/2016
Think the problem is to do with filtering by year, so when a week spans 2 years, it pushes in to week 53 - messing up all calculations.
So thought switching to financial year for this week would help solve the problem - almost worked.
Problem: Week 26 of 2015/16 became 27/12/2015 - 03/01/2016.
Fine - but why is it the only week in the entire financial year starting on a Sunday!!! It is meant to start on the 28/12/2015, and all other weeks start on a Monday - only this week that is an issue.
Please help
Thanks for responses.
Is there a way to fix the issue of week 53 dividing?
For example, what is happening is that 28th December 2015 - 3rd January 2016 is week 53.
When someone selects year 2015, week 53, they see 28th Dec to 31st Dec 2015 (great)
but when they select 2016, they need to select week 53 to see the remaining 1st to 3rd January.
Is there a way to rename this segment of the week as "1" rather than 53 so it appears at the beginning of the year?
Realise what is happening is that week 53 overlaps a year divide - so although a new year, it is still week 53 of previous year.
Other option I suppose is to divide the week declaration so new week always starts on 1st January...just wondering if another option first.
Many thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
week function will consider from Monday to Sunday as the week so if your new year day falling between Monday to Sunday then it will treat as belong to the last week
check this


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
