Transform: IFormulaTransformModel;
The Transform property returns the object, that enables to set up calculated series group options.
Executing the example requires a form with the Button1 button, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 that is a data source for TabSheetBox. Working area of the time series database must be loaded to UiErAnalyzer1. The database must contain the custom time series attribute COUNTRY.
Click the button to start executing the example.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Rubricator: IRubricator;
ErAn: IEaxAnalyzer;
Laner: ILaner;
TransformVar: IMsFormulaTransformVariable;
Coord: IMsFormulaTransformCoord;
Slice: IMsFormulaTransformSlice;
selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Det: IMsDeterministicTransform;
Term1: IMsFormulaTerm;
CalcGroupSer : ILanerCalculateGroupSerie;
Transform : IMsFormulaTransform;
MsMetaAttributeValue: IMsMetaAttributeValue;
MsMetaA: IMetaAttribute;
Begin
ErAn := UiErAnalyzer1.ErAnalyzer;
Laner := ErAn.Laner;
Rubricator := Laner.RubricatorInstance.Rubricator;
Laner.BeginUpdate;
CalcGroupSer := Laner.Series.AddCalculateGroupSerie(Rubricator);
CalcGroupSer.Name := "Argentina + 100";
Transform := CalcGroupSer.Transform.Transform As IMsFormulaTransform;
TransformVar := Transform.Outputs.Add(Null);
Coord := Transform.CreateCoord(TransformVar);
Slice := TransformVar.Slices.Add(Null);
Selector := Transform.CreateSelector;
Selector.Slice := Slice;
Formula := Transform.Transform(Selector);
Formula.Kind := MsFormulaKind.Deterministic;
Det := Formula.Method As IMsDeterministicTransform;
TransformVar := Transform.Inputs.Add(Null);
Slice := TransformVar.Slices.Add(Null);
MsMetaA := Rubricator.Facts.Attributes.FindById("COUNTRY");
MsMetaAttributeValue := Slice.MetaAttributeValueList.Add(MsMetaA);
MsMetaAttributeValue.Value := 213;
Term1 := Det.Operands.Add(Slice);
Det.Expression.AsString := Term1.TermToInnerText + " + 100";
Laner.EndUpdate;
End Sub Button1OnClick;
After executing the example a new group of series is added. This group includes the series, which COUNTRY attribute value is 213.
See also: