The function YEAR converts a date or time period to a year in number format. 

This function is useful if you want to easily compare years to see if they're the same. 

YEAR(Value to convert, [Time period method]) 

ArgumentData typeDescription
Value to convertDate, Time periodThe date or time period to convert to a year, as a number.
Time period method (optional)KeywordDetermines whether to extract the year from the start, middle, or end of a time period.

The keywords for the time period method argument are:

  • START, the default method, returns the year for the first date in the time period
  • MID, which returns the year for the date in the middle of the time period
  • END, which returns the year for the last date in the time period

The YEAR function returns a number. 

In this example, the line item Date is in Date format. The line item Number returns the Number format of the year using the formula YEAR(Date).


Jan 25Feb 25Mar 25Apr 25May 25
Date01/01/202502/02/202503/03/202504/04/202505/05/2025
Number
YEAR(Date)
2,0252,0252,0252,0252,025

In this example, the target module is dimensioned by a list with a property called Months. This is the List as viewed in Grid View.


ParentCodeMonths
1

Dec 21
2

Jan 21
3

Sep 22
4

Jul 24
5

Dec 23

The line item Input is in Time Period format in Month, and it has the formula List.Months to return the Months list items from the list. The line item Number returns the Number format of the year using the formula YEAR(Input).


12345
Input
List.Months
Dec 25Jan 21Sep 22Jul 24Dec 23
Number
YEAR(Input)
2,0252,0212,0222,0242,023

The example below shows YEAR(Value to convert). The values to convert are taken from the Product date and Year period line items. These are date and time period formatted, respectively. 


Key datesExpiry dates
Product released16/02/201623/08/2017
Year period Feb 16Aug 17

Product year

YEAR(Product released)

2,0162,017

Year number

YEAR(Year period)

2,0162,017

The next example shows YEAR(TIME. 'Period'). An explicit time reference is used instead of a line item. 


Key dates

Year Number 

YEAR(TIME. 'Apr 16')

2,016

The final example shows the effect of the Time period method argument. An explicit time reference is used with a keyword to determine which date in a time period to extract the year from.


Product: Plums
Start of fiscal yearWeek 1 FY2019

Year Start

YEAR(Start of fiscal year, START)

2,018

Year Mid

YEAR(TIME. 'FY19', MID)

2,019

Year End

YEAR(Start of fiscal year, END)

2,019