ITsCalendarSettings.WorkDayCount

Syntax

WorkDayCount: Integer;

Description

The WorkDayCount property returns the number of working days in a week.

Comments

The property is relevant for series with daily calendar frequency. The value of WorkDayCount is calculated as seven minus the number of days from the ITsCalendarSettings.RestDays property.

Example

This example displays a custom series calculation method. To execute the example, add links to the Dimensions, Ms, Transform system assemblies.

Function WorkDayCount(Input: ITimeSeries): Variant;
Var
    pContext: ITsCalculationContext;
    i: Integer;
    pSeries: ITimeSeries;
    CalendSett: ITsCalendarSettings;
Begin
    pContext := TsCalculation.Current;
    pSeries := pContext.CreateTimeSeries(DimCalendarLevel.Day);
    CalendSett := pContext.CalendarSettings;
    If (CalendSett.WorkDayCount = 5And (CalendSett.FirstDay = DayOfWeekSet.Monday) Then
        For i := Input.StartIndex To Input.EndIndex Do
            pSeries.Item(i) := 1 + Input.Item(i);
        End For;
    Else
        pContext.RaiseWarning("Used calendar parameters do not fit for method calculation");
    End If;
    Return pSeries;
End Function WorkDayCount;

The method increases input series values if the custom calculation method context is set on a five-day week and Monday is the beginning of the week.

See also:

ITsCalendarSettings