Skip to main content

PQL46 (PQL Function Library - CPM 4.6)

ADD_WORKDAYS

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

Description

This function adds working days to a given date based on a TFACS style calendar table.

The calendar table has to have the same layout as for WORKDAYS_BETWEEN.

ADD_WORKDAYS ( calendar_id, date, number_of_days )
  • calendar_id: defines which calendar out of the calendar table is used.

  • date: base date.

  • number_of_days: number of working days which are added to the base date.

If the calendar ID does not exist in the calendar table, ADD_WORKDAYS behaves like the ADD_DAYS function and adds the specified number of days to the date.

Example

[1] Here ADD_WORKDAYS is used without an existing work calendar. The function therefore adds the specified number of days.

Query

Column1

ADD_WORKDAYS ( "Table1"."Calendar_ID" , "Table1"."Column1" , 1 )

Input

Output

Table1

Column1 : DATE

Calendar_ID : STRING

Sat Apr 15 2017 00:00:00.000

'Non-existing Calendar ID'

Sun Apr 16 2017 00:00:00.000

'Non-existing Calendar ID'

Mon Apr 17 2017 00:00:00.000

'Non-existing Calendar ID'

Result

Column1 : DATE

Sun Apr 16 2017 00:00:00.000

Mon Apr 17 2017 00:00:00.000

Tue Apr 18 2017 00:00:00.000