ILanerSeries.AddCalculateSerieAsLocal

Syntax

AddCalculateSerieAsLocal(
    SerieName: String;
    Level: DimCalendarLevel;
    [ScenarioKey: Integer = -1;]
    [Index: Integer = -1]
): ILanerCalculateSerie;

Parameters

SerieName. The name of the series to be added.

Level. The calendar frequency of the series to be added.

ScenarioKey. The scenario of adding the series.

Index. Index of the position, into which the series must be added.

Description

The AddCalculateSerieAsLocal method adds a new data series.

Comments

If the ScenarioKey parameter has the -1 value, a series is created by the Fact scenario.

If the Index parameter has the -1 value, a series is added to the end of the series collection.

Example

Executing the example requires a workbook with the WORKBOOK_SERIES identifier that contains several series.

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

Sub UserProc;
Var
    mb: IMetabase;
    WbkObj: IMetabaseObject;
    EaxAn: IEaxAnalyzer;
    Laner: ILaner;
    Series: ILanerSeries;
    SerieCalc: ILanerCalculateSerie;
Begin
    // Get workbook
    mb := MetabaseClass.Active;
    WbkObj := mb.ItemById("WORKBOOK_SERIES").Edit;
    EaxAn := WbkObj As IEaxAnalyzer;
    Laner := EaxAn.Laner;
    // Get workbook series
    Series := Laner.Series;
    // Add empty series
    SerieCalc := Series.AddCalculateSerieAsLocal("New series", DimCalendarLevel.Year, -11);
    // Save changes
    WbkObj.Save;
End Sub UserProc

After executing this example, a new series that contains no data is added to the workbook after the first series. The mandatory attributes of this series are not determined.

See also:

ILanerSeries