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.

Comments

It is used to copy data between the Fact dimension and scenario dimensions.

Example

Executing the example requires the KONT_MODEL modeling container.

Add links to the Metabase and Ms system assemblies.

Sub UserProc;
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(11As Integer;
    Variable.CopyData(-1, KeyDest);
    Variable.Type := (Not MsVariableType.Loading) And (Not MsVariableType.Saving);
    MObj.Save;
End Sub UserProc;

After executing the example the data from the Fact dimension is copied to the first scenario dictionary of the VAR_1 modeling variable, and two additional parameters are disabled.

See also:

IMsVariable