Add(Attribute: IMetaAttribute): IMsMetaAttributeValues;
Attribute. Dictionary attribute.
The Add method adds a filter parameter.
Executing the example requires a time series database with the OBJ_RUBRICATOR identifier. COUNTRY is the custom attribute of time series database that refers to the dictionary. D_COUNTRY is a group of elements of this dictionary.
Sub Main;
Var
ActiveMetabase: IMetabase;
Ruby: IRubricator;
Transform: IMsFormulaTransform;
TransformVar: IMsFormulaTransformVariable;
Coord: IMsFormulaTransformCoord;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Det: IMsDeterministicTransform;
Term: IMsFormulaTerm;
TermInfo: IMsFormulaTermInfo;
MetaAttr: IMetaAttribute;
MetaVals: IMsMetaAttributeValues;
DimKey: Integer;
Group: IDimElementGroup;
Begin
ActiveMetabase := MetabaseClass.Active;
Ruby := ActiveMetabase.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
Transform := New MsFormulaTransform.Create(ActiveMetabase);
Transform.Rubricator := Ruby;
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;
MetaAttr := Ruby.Facts.Attributes.FindById("COUNTRY");
MetaVals := Transform.MetaAttributeFilter.Add(MetaAttr);
DimKey := MetaAttr.ValuesObject.Key;
Group := ActiveMetabase.ItemByIdNamespace("D_COUNTRY", DimKey).Edit As IDimElementGroup;
MetaVals.ElementGroup := Group;
TransformVar := Transform.Inputs.Add(Null);
Slice := TransformVar.Slices.Add(Null);
Term := Det.Operands.Add(Slice);
TermInfo := Term.TermInfo;
TermInfo.Lag := "-1";
Term.TermInfo := TermInfo;
Det.Expression.AsString := Term.TermToInnerText;
End Sub Main;
Executing this example creates an object that contains calculation options for series of the time series database.
See also: