Categorize By Calendar Weeks (1999 - Week 1, 1999 - Week 2)

Ever had the need to categorize/sort data so you can use it for fiscal months? This formula will categorize data based upon the fiscal week that a date field falls into. Armed with the knowledge of which fiscal weeks fall into a fiscal month, you can retrieve the summarized data from a view. 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 ; 52 ; @Integer((((Date-YearStartDate)/86400)/7)) + 1); @If ((((Date-YearStartDate)/86400)/7) < 0 ; @Text(@Year(Date)-1) + @Text(FiscalWeek) ; @Text(@Year(Date)) + @Text(FiscalWeek))

This was first published in November 2000

Dig deeper on Domino Resources - Part 3

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close