System Development, Software Updates, Quick Guides and Builder Training InformationBuilder Site Help Documentation Calculations and Table CalculationsWeek Start Calculation: Convert a date into a weekly number based on a specific start day during the Year

Week Start Calculation: Convert a date into a weekly number based on a specific start day during the Year

You can now access a weekstart calculation function. This enables users who operate on a weekly basis to tag their events as having occurred in a specific week of the year. This means a football club can designates each week to have a number, starting from preseason week 1 right through to finals occurring in week 27. To add the week of the year into the Event Form, you can set it up to start in the beginning of the year, or for any week throughout the year. See the following information on how to structure you Text Calculations to generate a start week.

To convert a date into a week of the year you need to have a Date field in the form, and then you add in a Text Calculation

Use the formula below to convert a date into week of the year:

weekstart(Date of Entry, day of week, how many to count, start week)

The day of week value ranges from 0 (Sunday) to 6 (Saturday):

-weekstart(Date of Entry, 0, 1, 1) takes the first Sunday of the year as week 1

-weekstart(Date of Entry, 1, 1, 1) takes the first Monday of the year as week 1

-weekstart(Date of Entry, 2, 1, 1) takes the first Tuesday of the year as week 1

-weekstart(Date of Entry, 3, 1, 1) takes the first Wednesday of the year as week 1

-weekstart(Date of Entry, 4, 1, 1) takes the first Thursday of the year as week 1

-weekstart(Date of Entry, 5, 1, 1) takes the first Friday of the year as week 1

-weekstart(Date of Entry, 6, 1, 1) takes the first Saturday of the year as week 1

The second number (how many to count) ranges from 1 (week 1) to 52 (week 52) and this is which week of the year you want to start counting from:

-weekstart(Date of Entry 0, 1, 1) takes the first Sunday of the year as week 1

-weekstart(Date of Entry 0, 2, 1) takes the second Sunday of the year as week 1

-weekstart(Date of Entry 0, 52, 1) takes the fifty second Sunday of the year as week 1

The third number (start week) ranges from 1 (week 1) to 52 (week 52) and this is which week of the year you want the start week to be:

-weekstart(Date of Entry 0, 1, 1) takes the first Sunday of the year as week 1

-weekstart(Date of Entry 0, 1, 2) takes the first Sunday of the year as week 2

-weekstart(Date of Entry 0, 1, 20) takes the first Sunday of the year as week 20

You can use different combinations of these days to set the start week to meet your exact specifications:

-weekstart(Date of Entry 2, 2, 2) takes the second Tuesday of the year and returns week 2

Setting up alternative start days or weeks

weekstart(Date of Entry, 1, 1, 2) takes the first Monday of the year as week 2

weekstart(Date of Entry 1, 2, 1) takes the second Monday of the year as week 1