ICubeCreator.EditCube

Syntax

EditCube(Cube: IStandardCube);

Parameters

Cube. The cube, which structure must be edited.

Description

The EditCube method edits the structure of the specified cube according to the determined settings of the current object.

Comments

On executing the example the specified cube structure is edited according to the set of dimensions and facts specified in the ICubeCreator.Dimensions and ICubeCreator.Facts properties, respectively. If local dimension of facts is used in the cube, it is reset. A new MDM table dictionary is created for fact dimension.

IMPORTANT. On editing the structure of the current cube the structure of the table, which stores cube data, is also edited. All old data is deleted.

Example

Executing the example requires the following objects in the repository:

Sub UserProc;
Var
    MB: IMetabase;
    CCreator: ICubeCreator;
    Facts: ICubeCreatorFacts;
    Dims: ICubeCreatorDimensions;
    Dim: IDimensionModel;
    CreatorDim1, CreatorDim2: ICubeCreatorDimension;
Begin
    MB := MetabaseClass.Active;
    //Cube creator
    CCreator := New CubeCreator.Create;
    CCreator.Database := MB.ItemById("DB").Open(NullAs IDatabaseInstance;
    //Cube dimensions collection
    Dims := CCreator.Dimensions;
    //New dimension, for which a personal dictionary is created
    CreatorDim1 := Dims.AddNew("Country");
    //Dimension that is based on the current dictionary
    Dim := MB.ItemById("CALENDAR").Bind As IDimensionModel;
    CreatorDim2 := Dims.Add(Dim);
    //Block index, by which the cube binding to the table fields is executed
    CreatorDim2.Index := Dim.Blocks.Item("YEARS").Indexes.PrimaryIndex;
    //Cube facts
    Facts := CCreator.Facts;
    Facts.Add("Value");
    //Edit cube
    CCreator.EditCube(MB.ItemById("STD_CUBE").Bind As IStandardCube);
End Sub UserProc;

On executing the example the specified cube structure is edited. The structure will contain two dimensions, a separate dictionary is created for facts. All previous cube data is deleted.

See also:

ICubeCreator