ILanerSerie.CalendarDim

Syntax

CalendarDim: IDimInstance;

Description

The CalendarDim property returns series calendar.

Comments

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

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:

See also:

ILanerSerie