SourceStub: IVariableStub;
The SourceStub property returns the data of the series as of an abstract data source.
The property returns Null if the series does not have the (ILanerCalculateSerie.Source) source.
Executing the example requires a form with the following components: the Button component named Button1, the TabSheetBox component named TabSheetBox1, and the UiErAnalyzer component named UiErAnalyzer1. UiErAnalyzer1 is a data source for TabSheetBox1. A working area of the time series database should be loaded to UiErAnalyzer1.
The example is a handler of the OnClick event for the Button1 component.
Add links to the Cubes, Express, ExtCtrls, Forms, Laner, Ms, and Tab system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ErAn: IEaxAnalyzer;
Laner: ILaner;
Series: ILanerSeries;
CalcSerie, Serie: ILanerCalculateSerie;
tr: IMsFormulaTransform;
OutVar, InpVar: IMsFormulaTransformVariable;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Determ: IMsDeterministicTransform;
TermInfo: IMsFormulaTermInfo;
Begin
ErAn := UiErAnalyzer1.ErAnalyzer;
Laner := ErAn.Laner;
Laner.BeginUpdate;
Series := Laner.Series;
CalcSerie := Series.Item(0) As ILanerCalculateSerie;
Serie := Series.AddCalculateSerieAsSource(CalcSerie.Source);
Serie.Name := Serie.SourceStub.Name + " + 10";
Serie.UseTransform := True;
tr := Serie.Transform.Transform As IMsFormulaTransform;
OutVar := tr.Outputs.Item(0);
Slice := OutVar.Slices.Add(Null);
Selector := tr.CreateSelector;
Selector.Slice := Slice;
Formula := tr.Transform(Selector);
Formula.Kind := MsFormulaKind.Deterministic;
Determ := Formula.Method As IMsDeterministicTransform;
InpVar := tr.Inputs.Add(Serie.SourceStub);
Slice := InpVar.Slices.Add(Null);
TermInfo := tr.CreateTermInfo;
TermInfo.Slice := Slice;
Determ.Expression.AsString := TermInfo.TermInnerText + " + 10";
Laner.EndUpdate;
End Sub Button1OnClick;
After executing the example the calculated series, that is based on the data of the workbook first series, is added to the workbook.
See also: