In a formula-type column, the YEAR_MONTH() function displays the year and month from a date-type column.
-
Function name:
YEAR_MONTH()
Syntax
YEAR_MONTH(date_column)
Calling function parameters 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 extract the year and month. |
Example
YEAR_MONTH($Date)
The Project 1 takes place in the 4th month of the year 2022.
Return type
The function returns the year and month of the date.
The output type format of the result 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_MONTH() serves as a monthly grouping key: aggregating revenue by month, sorting records by year-month, feeding a pivot table by period.
Best practice
Placing the year before the month ensures correct chronological sorting, unlike displaying the month alone which would mix years.