In a formula type column, the YEAR_WEEK() function displays the year and week of a date type column.
-
Date function name:
YEAR_WEEK()
Syntax
YEAR_WEEK(date_column)
Function parameter notation in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to add within quotation marks.
- do not use quotation marks for numbers.
Parameters
| Parameter | Description |
|---|---|
date_column |
The date type column from which you want to get the year and week. |
Example
YEAR_WEEK($Date)
The column returns the year and the corresponding week number for the date.
Return type
The function returns the year and week of the date.
The output result format type 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
YEAR_WEEK() serves as a reliable weekly grouping key across multiple years: weekly reporting, pace tracking.
Best practice
Placing the year before the week ensures correct chronological sorting when transitioning from one year to another.