CompareLevels(Level1: DimCalendarLevel; Level2: DimCalendarLevel): CalendarCompareLevelsResult;
Level1, Level2. Calendar levels.
The CompareLevels method is used to determine result of comparing of calendar levels.
To get index of the specified calendar level, use the ICalendarDimension.CalendarLevelIndex property.
Executing the example requires a calendar dictionary with the D_CALENDAR identifier with set up calendar levels.
Add links to the Metabase and Dimensions system assemblies.
Sub UserProc;
Var
mb: IMetabase;
mbObj: IMetabaseObject;
Cal : ICalendarDimension;
Res : CalendarCompareLevelsResult;
StrRes: String;
Begin
mb := MetabaseClass.Active;
mbObj :=mb.ItemById("D_CALENDAR").Bind;
Cal := mbObj As ICalendarDimension;
Res := Cal.CompareLevels(DimCalendarLevel.Quarter,DimCalendarLevel.Month);
StrRes:=(Res As Variant) As String;
Select Case StrRes
Case "-2": Debug.WriteLine("Non-applicable");
Case "-1": Debug.WriteLine("Less");
Case "0": Debug.WriteLine("Equal");
Case "1": Debug.WriteLine("Greater");
End Select;
End Sub UserProc;
After executing the example the console window displays result of comparing of the specified calendar levels.
See also: