Brian Dunning's FileMaker Custom Functions

WeekofFiscalYear ( TheDate ; StartingDay ; StartMonth ; StartDay )

A generalization of FMP's WeekofYearFiscal( TheDate ; StartingDay ) in that this function allows the user to specify the starting month and day for the Fiscal Year (not the usual Jan 1st).

  Average rating: 4.4 (32 votes) Log in to vote

Jason L. DeLooze   Jason L. DeLooze
Nocturnal MicroSystems
http://n/a

Share on Facebook Share on Twitter

  Sample input:
WeekofFiscalYear(5/15/2004;1;7;1)
  Sample output:
46

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

A generalization of FMP's WeekofYearFiscal( TheDate ; StartingDay ) in that this function allows the user to specify the starting month and day for the Fiscal Year (not the usual Jan 1st).

Parameters:

TheDate: any valid date;

StartingDay: a number from 1 to 7, representing the first day of the week (1 -> Sun, 2 -> Mon, ..., 7 -> Sat).

StartMonth: a number from 1 to 12, representing the month marking the start of the Fiscal Year.

StartDay: a day number in StartMonth from 1 to last day of StartMonth, representing the day in StartMonth marking the start of the Fiscal Year.

Output: a number from 1 to 53 representing the week of the Fiscal Year in which TheDate falls.

 

Comments

Katy Butterworth   Katy Butterworth, New Zealand
Apr 12, 2011
I just wanted to say "thank you", this saved me a huge amount of time.

I have been trying to get the week numbers for dates we export to another system where they start their week numbereing on the last Monday of December!

Thank you for sharing.
 
Phil   Phil, Poole, UK
Jun 16, 2014
I've tried to do this my self numerous times, but never managed to get it quite right.

Saved me a lot of hassle,
Thanks very much!
 
Greg   Greg, Brisbane, Australia
Apr 5, 2016
Like Katy and Phil, Ive been trying to get this to work for ages. Thank you! :-D
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.