ILanerCalculateSerie.Error

Syntax

Error: String;

Description

The Error method displays the errors occurred during the series calculation.

Example

Executing the example requires a form with the following components: the Button component named Button1, the Memo component named Memo1, the TabSheetBox component named TabSheetBox1, and the UiErAnalyzer component named UiErAnalyzer1. UiErAnalyzer1 is a data source for TabSheetBox1. A working area of a time series database, which data table has more than one data series, should be loaded to UiErAnalyzer1.

The example is a handler of the OnClick event for the Button1 component.

Add links to the Collections, Cubes, Dimensions, Express, ExtCtrls, Forms, Laner, Ms, and Tab system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Laner: Ilaner;
    UsingSerie, UsingSerie2: ILanerSerie;
    NewSerie: ILanerCalculateSerie;
    Str: String;
    Trasss: IFormulaTransformModel;
    ms: IMsFormulaTransform;
    TransformVar: IMsFormulaTransformVariable;
    Coord: IMsFormulaTransformCoord;
    Slice: IMsFormulaTransformSlice;
    selector: IMsFormulaTransformSelector;
    Formula: IMsFormula;
    Det: IMsDeterministicTransform;
    Term1, Term2: IMsFormulaTerm;
Begin
    Laner := UiErAnalyzer1.ErAnalyzer.Laner;
    Laner.BeginUpdate;
    UsingSerie := Laner.Series.Item(0As ILanerSerie;
    UsingSerie2 := Laner.Series.Item(1As ILanerSerie;
    Str := "Summ_(" + UsingSerie.Name + " , " + UsingSerie2.Name + ")";
    NewSerie := Laner.Series.AddCalculateSerie(Str);
    Trasss := NewSerie.Transform;
    Trasss.AddInputVariable(UsingSerie.Stub);
    Trasss.AddInputVariable(UsingSerie2.Stub);
    ms := Trasss.Transform As IMsFormulaTransform;
    TransformVar := ms.Outputs.Item(0);
    Coord := ms.CreateCoord(TransformVar);
    Slice := TransformVar.Slices.Add(Null);
    Selector := ms.CreateSelector;
    Selector.Slice := Slice;
    Formula := ms.Transform(Selector);
    Formula.Kind := MsFormulaKind.Deterministic;
    Formula.Level := DimCalendarLevel.Year;
    Det := Formula.Method As IMsDeterministicTransform;
    TransformVar := ms.Inputs.Add(UsingSerie.Stub);
    Slice := TransformVar.Slices.Add(Null);
    TransformVar := ms.Inputs.Add(UsingSerie.Stub);
    Slice := TransformVar.Slices.Add(Null);
    Term1 := Det.Operands.Add(Slice);
    TransformVar := ms.Inputs.Add(UsingSerie2.Stub);
    Slice := TransformVar.Slices.Add(Null);
    Term2 := Det.Operands.Add(Slice);
    Det.Expression.AsString := Term1.TermToInnerText + " + " + Term2.TermToInnerText;
    NewSerie.Calculate;
    Memo1.Lines.Add(NewSerie.Error);
    Laner.EndUpdate;
End Sub Button1OnClick;

After executing the example the new calculated series which is the sum of the two first series data is added. The errors occurred during the calculation are displayed in the Memo1 component.

See also:

ILanerCalculateSerie