Source: IRubricatorFactor;
The Source property determines the calculated series source.
Executing the example requires a form with the Button1 button, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 which is used as a data source for TabSheetBox. Workbook of the time series database must be loaded to UiErAnalyzer1.
Click the button to start executing this example.
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: