CopyData(Source: Integer; Destination: Integer);
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.
The CopyData method copies the data between variable dimensions. It is used to copy data between the Fact dimension and scenario dimensions.
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: