IRubricatorAutoPeriodDate.Fixed

Syntax

Fixed(Level: DimCalendarLevel, FirstDayOfWeek: DayOfWeekSet): DateTime;

Parameters

Level. Calendar level.

FirstDayOfWeek. First day of the week. It is actual for data with daily and weekly calendar frequencies.

Description

The Fixed method returns period date.

Comments

The property is relevant if IRubricatorAutoPeriodDate.IsFixed = True, that is, period date is set absolutely or relatively to the current date.

Example

Executing the example requires a time series database with the FC_AUTO identifier that contains an export object with the OBJ_EXPORT identifier. Add links to the Metabase, Cubes and Dimensions system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    RubKey: Integer;
    Obj: IMetabaseObject;
    ExportRequestDef: IExportRequestDefinition;
    ExpParams: IExportRequestParams;
    ExpPeriod: IRubricatorAutoPeriod;
    ExpPeriodDate: IRubricatorAutoPeriodDate;
Begin
// Receive export object
    MB := MetabaseClass.Active;
    RubKey := MB.GetObjectKeyById("FC_AUTO");
    Obj := MB.ItemByIdNamespace("OBJ_EXPORT", RubKey).Bind;
    ExportRequestDef := Obj As IExportRequestDefinition;
// Edit export parameters
    ExpParams := ExportRequestDef.Exporter;
    ExpPeriod := ExpParams.AutoPeriod;
    ExpPeriodDate := ExpPeriod.Start;
    Debug.Write(Period start: );
    If ExpPeriodDate.IsFixed Then
        Debug.WriteLine(ExpPeriodDate.Fixed(DimCalendarLevel.Week, DayOfWeekSet.Monday));
    Else
        Debug.WriteLine(data start, );
        Debug.WriteLine(shift:  + ExpPeriodDate.Offset.ToString);
    End If;
    ExpPeriodDate := ExpPeriod.End_;
    Debug.Write(Period end: );
    If ExpPeriodDate.IsFixed Then
        Debug.WriteLine(ExpPeriodDate.Fixed(DimCalendarLevel.Week, DayOfWeekSet.Monday));
    Else
        Debug.Write(data end, );
        Debug.WriteLine(shift:  + ExpPeriodDate.Offset.ToString);
    End If;
End Sub UserProc;

After executing the example information on the time series export period start or end using the OBJ_EXPORT object is displayed in the console window.

See also:

IRubricatorAutoPeriodDate