Skip to main content

PQL46 (PQL Function Library - CPM 4.6)

ROUND_WEEK

Applies to: CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4 CELONIS 4.5 CELONIS 4.6

Description

This function rounds a DATE input down to the week by setting its HOUR, MINUTE, SECOND and MILLISECOND values to their ground state. The DAY value is set to the Monday of the week of that date.

Syntax
ROUND_WEEK ( table.date_column )
Example

[1] Round dates down to the week.

Query

Column1

ROUND_WEEK ( "Table1"."Date" )

Input

Output

Table1

Date : DATE

Mon May 08 2006 23:59:59.999

Fri Dec 31 1999 23:59:59.999

Fri Jan 01 2016 00:59:59.000

Fri Jan 01 1993 00:00:00.000

Result

Column1 : DATE

Mon May 08 2006 00:00:00.000

Mon Dec 27 1999 00:00:00.000

Mon Dec 28 2015 00:00:00.000

Mon Dec 28 1992 00:00:00.000