Quarter(El: Integer): Integer;
El — element index.
The Quarter method returns quarter index for the calendar dictionary element, index of which is passed by the El parameter. It returns -1 if the dictionary does not have the Quarters level.
Sub Main;
Var
MB: IMetabase;
Obj: IMetabaseObjectDescriptor;
CalClass: CalendarDimInstanceFactory;
Dim: IDimInstance;
CalInst: ICalendarDimInstance;
i: Integer;
Begin
Mb:=MetabaseClass.Active;
Obj:=Mb.ItemById("CALENDAR_DIM");
Dim:=Obj.Open(Null) As IDimInstance;
CalClass:=New CalendarDimInstanceFactory.Create;
CalInst:=CalClass.CreateCalendarDimInstance(Dim);
i:=CalInst.Quarter(Dim.Elements.FindById("DAYS:12.12.2002"));
End Sub Main;
After executing the example the "i" variable contains index of calendar dictionary element corresponding to the fourth quarter of 2002. Dictionary identifier: CALENDAR_DIM.
See also: