Skip to main content

Celonis Product Documentation

CALENDAR_WEEK
Description

CALENDAR_WEEK returns the calendar week of a given date. Celonis follows the standard ISO 8601 for numbering the calendar weeks.

The standard defines Monday as the first day of the week and the first week of the year as the one with the 4th of January.

Supported input column types: DATE

Output column type: INT

Syntax
  CALENDAR_WEEK ( table.column )
 
NULL handling

If any parameter is NULL, the result is NULL as well.

Example

[1]

This example shows in which calendar week the 1st of January is depending on the weekday. The 1st of January 2018 is a Monday, 2019 it is a Tuesday, 2014 Wednesday and so on. If the 1st of January is Friday, Saturday or Sunday the week still "belongs" to the previous year.

Query

Column1

         CALENDAR_WEEK ( "Table1"."Column1" )
        

Input

Output

Table1

Column1 : date

Mon Jan 01 2018 00:00:00.000

Tue Jan 01 2019 00:00:00.000

Wed Jan 01 2014 00:00:00.000

Thu Jan 01 2015 00:00:00.000

Fri Jan 01 2016 00:00:00.000

Sat Jan 01 2022 00:00:00.000

Sun Jan 01 2017 00:00:00.000

Result

Column1 : int

1

1

1

1

53

52

52