ITsCalculationContext.Levels

Syntax

Levels: DimCalendarLevelSet;

Description

The Levels property returns the set of calendar frequencies available for custom method calculation.

Example

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

Function WorkDayCount(Input: ITimeSeries): ITimeSeries;
Var
    pContext: ITsCalculationContext;
    i: Integer;
    pSeries: ITimeSeries;
Begin
    pContext := TsCalculation.Current;
    pSeries := pContext.CreateTimeSeries(DimCalendarLevel.Day);
    If pContext.Levels = DimCalendarLevelSet.Day 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 up to daily frequency.

See also:

ITsCalculationContext