TimeSeries.CreateLevel

Fore Syntax

CreateLevel(CalendarLevel: DimCalendarLevel);

Fore.NET Syntax

CreateLevel(
    CalendarLevel: Prognoz.Platform.Interop.Dimensions.DimCalendarLevel;
    Context: Prognoz.Platform.Interop.Fore.ForeRuntimeContext);

Parameters

CalendarLevel. Series calendar frequency.

Context. Context. It is relevant only for Fore.NET.

Description

The CreateLevel constructor creates a series with set calendar frequency.

Comments

Use the TimeSeries.Create default constructor to create a series without additional parameters.

Fore Example

A custom series calculation method is given in the example. To execute the example, add a link to the Dimensions system assembly.

Function TimeCalendLvl(Input: ITimeSeries): ITimeSeries;
Var
    i: Integer;
    pSeries: ITimeSeries;
Begin
    pSeries := New TimeSeries.CreateLevel(DimCalendarLevel.Year);
    If pSeries.CheckCompatible(Input, TrueThen
        For i := pSeries.StartIndex To pSeries.EndIndex Do
            pSeries.Item(i) := 1 + Input.Item(i);
        End For;
    End If;
    Return pSeries;
End Function TimeCalendLvl;

The method increases input series values if it is compatible with the user calculation method context.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;

Public Function TimeCalendLvl(Input: TimeSeries): ITimeSeries;
Var
    i: Integer;
    pSeries: ITimeSeries;
Begin
    pSeries := New TimeSeriesClass.Create();
    pSeries.CreateLevel(DimCalendarLevel.dclYear, Null);
    If pSeries.CheckCompatible(Input, TrueThen
        For i := pSeries.StartIndex To pSeries.EndIndex Do
            pSeries.Item[i] := 1 + (Input.Item[i] As double);
        End For;
    End If;
    Return pSeries;
End Function TimeCalendLvl;

See also:

TimeSeries