IMsVariable.CopyData

Syntax

CopyData(Source: Integer; Destination: Integer);

Parameters

Source. Key of dimension, from which it is necessary to copy the data. If it is necessary to copy data of the Fact dimension, value -1 is set.

Destination. Key of consumer dimension, to which data is copied.

Description

The CopyData method copies the data between variable dimensions. It is used to copy data between the Fact dimension and scenario dimensions.

Example

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Variable: IMsVariable;

ScenInst: IDimInstance;

KeyDest: Integer;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemByIdNamespace("Var_1", MB.ItemById("KONT_MODEL").Key).Edit;

Variable := MObj As IMsVariable;

ScenInst := Variable.ScenarioDimension;

KeyDest := ScenInst.Elements.AttributeValue(1, 1) As Integer;

Variable.CopyData(-1, KeyDest);

MObj.Save;

End Sub Main;

After executing the example the data from the Fact dimension is copied to the first scenario dictionary of the Var_1 modeling variable.

See also:

IMsVariable