ILanerSerie.CalendarDim

Fore Syntax

CalendarDim: IDimInstance;

Fore.NET Syntax

CalendarDim: Prognoz.Platform.Interop.Dimensions.IDimInstance;

Description

The CalendarDim property returns series calendar.

Comments

If the workbook contains series that use different calendars the property ILaner.CalendarDim returns NULL.

Fore Example

Executing the example requires a form with the LanerBox component and the UiErAnalyzer component named UiErAnalyzer1 used as a data source for LanerBox. Workbook of the time series database must be loaded to UiErAnalyzer1.

Add a link to the Dimensions system assembly.

Sub UserProc;
Var
    Laner: ILaner;
    i: Integer;
    Series: ILanerSeries;
    LSerie: ILanerSerie;
    Calendar: IDimInstance;
    Tbl: ILanerTable;
    TopH: ILanerTopHeader;
Begin
    Laner := UiErAnalyzer1.ErAnalyzer.Laner;
    If Laner.CalendarDim = Null Then
        Series := Laner.Series;
        Debug.WriteLine("Keys of used calendar dictionaries:");
        For i := 0 To Series.Count - 1 Do
            LSerie := Series.Item(i);
            Calendar := LSerie.CalendarDim As IDimInstance;
            Debug.WriteLine(Calendar.Key);
        End For;
        Tbl := Laner.Execute;
        TopH := Tbl.TopHeader;
        Debug.WriteLine("Workbook calendar that contains frequency levels:");
        For i := 0 To TopH.ElementCount - 1 Do
            Debug.Write(TopH.DimensionDate(0, i));
            Select Case TopH.DimensionLevel(0, i)
                Case DimCalendarLevel.Day: Debug.WriteLine(" - days");
                Case DimCalendarLevel.HalfYear: Debug.WriteLine(" - half-years");
                Case DimCalendarLevel.Month: Debug.WriteLine(" - months");
                Case DimCalendarLevel.NineMonths: Debug.WriteLine(" - 9 months");
                Case DimCalendarLevel.Quarter: Debug.WriteLine(" - quarters");
                Case DimCalendarLevel.Week: Debug.WriteLine(" - weeks");
                Case DimCalendarLevel.Year: Debug.WriteLine(" - years");
            End Select;
        End For;
    End If;
End Sub UserProc;

After executing the procedure, if the workbook series use different calendars, the console window displays:

Fore.NET Example

Executing the example requires a .NET form with the LanerBoxNet component and the UiErAnalyzerNet component named UiErAnalyzerNet1, that is a data source for LanerBoxNet. Workbook of the time series database must be loaded to UiErAnalyzerNet1.

Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub UserProc;
Var
    Laner: ILaner;
    i: Integer;
    Series: ILanerSeries;
    LSerie: ILanerSerie;
    Calendar: IDimInstance;
    Tbl: ILanerTable;
    TopH: ILanerTopHeader;
Begin
    Laner := UiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.Laner;
    If Laner.CalendarDim = Null Then
        Series := Laner.Series;
        System.Diagnostics.Debug.WriteLine("Keys of used calendar dictionaries:");
        For i := 0 To Series.Count - 1 Do
            LSerie := Series.Item[i];
            Calendar := LSerie.CalendarDim As IDimInstance;
            System.Diagnostics.Debug.WriteLine(Calendar.Key);
        End For;
        Tbl := Laner.Execute();
        TopH := Tbl.TopHeader;
        System.Diagnostics.Debug.WriteLine("Workbook calendar that contains frequency levels:");
        For i := 0 To TopH.ElementCount - 1 Do
            System.Diagnostics.Debug.Write(TopH.DimensionDate[0, i]);
            Select Case TopH.DimensionLevel[0, i]
                Case DimCalendarLevel.dclDay: System.Diagnostics.Debug.WriteLine(" - days");
                Case DimCalendarLevel.dclHalfYear: System.Diagnostics.Debug.WriteLine(" - half-years");
                Case DimCalendarLevel.dclMonth: System.Diagnostics.Debug.WriteLine(" - months");
                Case DimCalendarLevel.dclNineMonths: System.Diagnostics.Debug.WriteLine(" - 9 months");
                Case DimCalendarLevel.dclQuarter: System.Diagnostics.Debug.WriteLine(" - quarters");
                Case DimCalendarLevel.dclWeek: System.Diagnostics.Debug.WriteLine(" - weeks");
                Case DimCalendarLevel.dclYear: System.Diagnostics.Debug.WriteLine(" - years");
            End Select;
        End For;
    End If;
End Sub;

After executing this procedure, if the workbook series use different, calendars the console window displays:

See also:

ILanerSerie