INTERSECT
Description
A call to INTERSECT takes two arbitrary calendars as input and produces a new intersected calendar (its type depends on the input calendars).
The currently supported calendars are
At all places where a calendar is expected (e.g., in REMAP_TIMESTAMPS), a calendar intersection can be used as well (as the intersection produces a new calendar as output).
Syntax
INTERSECT ( lhs_calendar, rhs_calendar )
lhs_calendar: one of WEEKDAY_CALENDAR, FACTORY_CALENDAR, WORKDAY_CALENDAR, or another call to INTERSECT
rhs_calendar: one of WEEKDAY_CALENDAR, FACTORY_CALENDAR, WORKDAY_CALENDAR, or another call to INTERSECT
Examples
[1] Here we use REMAP_TIMESTAMPS to calculate the number of passed minutes since 1970-01-01 for several dates in the 'Timestamps' column. The calendar specified is a calendar intersection between two weekday calendars. If one weekday calendar does not cover a certain weekday (e.g., the second weekday calendar in the intersection does not cover 'WEDNESDAY'), it will also not be covered by their intersection. For the shifts the intersection algorithm takes max(lhs_begin,rhs_begin) as the new begin of the shift and min(lhs_end,rhs_end) as the new end of the shift (where 'lhs' refers to the left-hand side calendar of the intersection input and 'rhs' to the right-hand side). | ||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||
|
[2] Here we use REMAP_TIMESTAMPS to calculate the number of passed hours since 1970-01-01 for several dates in the 'Timestamps' column. The calendar specified is a calendar intersection between a workday calendar (configured for the years 2018 and 2019) and a weekday calendar with shifts. The result of the calendar intersection will be a workday calendar which has the corresponding shifts of the weekday calendar. Note that the weekday calendar does not cover the weekday WEDNESDAY and thus all wednesdays are marked as invalid workdays in the workday calendar. All other weekdays are covered by the weekday calendar with a shift from 09:00-17:00. However, because weekends are not valid workdays in the workday calendar, these are ignored in the calendar computations (together with all public holidays such as the first of January) although the weekends are configured in the weekday calendar. Also, all days before 2018-01-01 are ignored as the first year covered by the workday calendar is the year 2018. More information for the inner workings of the WORKDAY_CALENDAR can be found in its documentation. The following example starts with the second of January 2018 which is a Tuesday. It is both a valid workday according to the workday calendar and also covered by the weekday calendar for the time from 09:00 until 17:00. In the example, we can see that the third of January 2018 is ignored because it was a Wednesday and is thus not covered by the weekday calendar. The last date in the example (i.e., 2018-01-08 16:30:00) is a Monday. The following days are ignored in the calculations:
The following days and shifts are considered in the calendar computations:
In total, this makes 24 hours + 7.5 hours = 31.5 hours which will be rounded down to 31 hours. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
[3] Here we use REMAP_TIMESTAMPS to calculate the number of passed minutes since 1970-01-01 for several dates in the 'Timestamps' column. The calendar specified is a calendar intersection between a workday and a factory calendar. The result of the intersection would be a factory calendar. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|