IMsMetaAttributeValue.Kind

Syntax

Kind: MsMetaAttributeValueType;

Description

The Kind property determines how to set values of the attribute, on which the variable is based.

Comments

To specify the attribute value, use the IMsMetaAttributeValue.Value property. The attribute value (the IMsMetaAttributeValue.IsParameter property must be set to False) or parameter identifier, that passes the value (the IMsMetaAttributeValue.IsParameter property must be set to True), is specified in it.

If value of attribute is not specified, it is taken from input series of the model that calculates a variable. The value of the IMsMetaAttributeValue.Value and the IMsMetaAttributeValue.IsParameter properties is ignored.

Example

Executing the example requires that the repository contains a time series database with the FC identifier. A model with the MODEL_ATTR identifier must be available in the modeling container of this database. Also, before executing the procedure it is necessary to add links to the Ms, Cubes, Rds, Metabase system assemblies.

Sub UserProc;

Var

Mb: IMetabase;

RubrDescr: IMetabaseObjectDescriptor;

Rubr: IRubricator;

MsDescr: IMetabaseObjectDescriptor;

Model: IMsModel;

Transform: IMsFormulaTransform;

TransformVarables: IMsFormulaTransformVariables;

TransVar: IMsFormulaTransformVariable;

Slice: IMsFormulaTransformSlice;

AttrValList: IMsMetaAttributeValueList;

AttrVal: IMsMetaAttributeValue;

FactsAttrs: IMetaAttributes;

Attr: IMetaAttribute;

Begin

Mb := MetabaseClass.Active;

RubrDescr := Mb.ItemById("FC");

Rubr := RubrDescr.Bind As IRubricator;

MsDescr := Rubr.ModelSpace;

Model := Mb.ItemByIdNamespace("MODEL_ATTR", MsDescr.Key).Edit As IMsModel;

Transform := Model.Transform;

TransformVarables := Transform.Outputs;

TransVar := TransformVarables.Item(0);

Slice := TransVar.Slices.Item(0);

AttrValList := Slice.MetaAttributeValueList;

AttrValList.Clear;

FactsAttrs := Rubr.Facts.Attributes;

Attr := FactsAttrs.FindById("UNIT");

AttrVal := AttrValList.Add(Attr);

AttrVal.Kind := MsMetaAttributeValueType.Unspecified;

(Model As IMetabaseObject).Save;

End Sub UserProc;

After executing the example the attribute of factors UNIT (units) is added for the model's output variable slice. Its value is not specified. Thus, on calculating the model, values of this attribute for the output variables are checked. If the values match, this value is written to the attribute of output variable, otherwise the attribute value is not changed.

See also:

IMsMetaAttributeValue