A friend of mine, Tracy, has some greatly improved code for getting the fiscal week in the year.
Tracy Lankford, MCSE,
Lotus Notes Manager
I started thinking about this and came up with a much simpler way.
For just the number, you can use @Businessdays to count the number of Sundays that have elapsed. For example...
This does return "week zero" for the first few days of the year before the first Sunday, but that's fine with me.
The next problem was turning this "week number" into an actual date. For that, this formula works...
There is probably a slightly simpler way to do this part,
In both the above, "PAdate" is the date field I want the fiscal week of.
This document is from the Advisor via the Search Domino tips emails.
By Jeff Crossett
Buffalo, New York
This formula allows you to categorize by fiscal weeks.
Date := YourDateField ;
Date2 := @TextToTime("1/1/" + @Text(@Year(Date))) ;
DaysToStartDate := 7 - ((@Weekday(Date2)) -1) ;
YearStartDate := @Adjust(Date2;0;0; DaysToStartDate; 0;0;0) ;
FiscalWeek := @If((((Date-YearStartDate)/86400)/7) < 0 ;
@Integer((((Date-YearStartDate)/86400)/7)) + 1) ;
@If ((((Date-YearStartDate)/86400)/7) < 0 ;
@Text(@Year(Date)-1) + @Text(FiscalWeek) ;
@Text(@Year(Date)) + @Text(FiscalWeek))