Brian Dunning's FileMaker Custom Functions

WeekFiscalToDate ( Yearnr ; WeeknrOfYear ; Firstweekday )

Calculate date from fiscal-weeknumber and year

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

Menno van Beek   Menno van Beek
Van Beek Zakelijke Software
https://www.vbzs.nl

Share on Facebook Share on Twitter

  Sample input:
WeekFiscalToDate ( 2013 ; 5 ; 2 )
WeekFiscalToDate ( 2015 ; 5 ; 1 )
WeekFiscalToDate ( 2015 ; 5 ; 2 )
  Sample output:
1/28/2013
2/1/2015
1/26/2015

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

This function works more or less as the inverse function of WeekOfYearFiscal(), which is built into Filemaker. Only instead of calculating the weeknumber, it calculated the date for the given day of the given weeknr.

The function can also be used to calculate a particular occurrence of a day in a given month:
WeekFiscalToDate ( Year ; WeekOfYearFiscal ( Date ( Month ; 7 * occurrence ; Year ) ; Firstweekday ) ; Firstweekday )
example: You'd like to calculate the 3rd occurrence of thursday in april:
WeekFiscalToDate ( 2013 ; WeekOfYearFiscal ( Date ( 4 ; 7 * 3 ; 2013 ) ; 5 ) ; 5 ) which would result into 4/18/2013
for 2014: 4/17/2014
for 2015: 4/16/2015
for 2016: 4/21/2016

 

Comments

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.