ILanerTransformPeriod.OutputAutoPeriod

Syntax

OutputAutoPeriod: Integer;

Description

The OutputAutoPeriod property determines the conditions used to calculate start and end dates of data loading period.

Comments

The conditions are set by means of the MsDateAutoPeriodOptions enumeration.

Example

Executing the example requires that the repository contains a workbook with the WB_OUTPUT identifier that contains one or several calculated series.

Add links to the Express, Laner and Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ErAn: IEaxAnalyzer;
    Laner: ILaner;
    Series: ILanerSeries;
    i: Integer;
    Serie: ILanerCalculateSerie;
    Period: ILanerTransformPeriod;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get workbook
    ErAn := mb.ItemById("WB_OUTPUT").Edit As IEaxAnalyzer;
    Laner := ErAn.Laner;
    // Get all series in the workbook
    Series := Laner.Series;
    // Start parsing series
    For i := 0 To Series.Count - 1 Do
        Serie := Series.Item(i) As ILanerCalculateSerie;
        // If a series is calculated, set data loading period for it
        If Serie.Kind = LnSerieKind.Calculate Then
            Period := Serie.TransformPeriod;
            // Data loading period will be set by means of conditions:
            // start and end dates of the period are equal to the current number
            // plus/minus set number of periods
            Period.OutputAutoPeriod := MsDateAutoPeriodOptions.UseNowAndOffsets;
            // Number of periods, by which data loading period start date is offset
            Period.OutputStartOffset := -10;
            // |Number of periods, by which data loading period end date is offset
            Period.OutputEndOffset := 5;
        End If;
    End For;
    // Save changes
    (ErAn As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a data loading period is set for all calculated series in the workbook by means of the conditions.

See also:

ILanerTransformPeriod