In a formula-type column, the WEEK() function displays the week number of a date-type column.
-
Date function name:
WEEK()
Syntax
WEEK(date_column)
Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to be added within quotes.
- do not use quotes for numbers.
Parameters
| Parameter | Description |
|---|---|
date_column |
The date-type column for which you want the week number. |
Example
WEEK($Date)
The column returns the week number corresponding to the date.
Return type
The function returns a number (the week number in the year).
The output type format can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula Column article.
Business use case
WEEK() is used as a weekly grouping key: tracking production by week, scheduling, weekly reporting.
Best practice
For unambiguous chronological sorting from year to year, combine WEEK() with YEAR() or use YEAR_WEEK().