ICubeCreator.AdditionalFields

Syntax

AdditionalFields: ICubeCreatorAdditionalFields;

Description

The AdditionalFields property returns the collection of additional fields that are not linked to cube dimensions or facts.

Comments

Additional fields are created in the output matrix of cube, but are not linked to cube structure dimensions or facts.

Example

Executing the example requires the following objects in repository:

Sub UserProc;
Var
    MB: IMetabase;
    CCreator: ICubeCreator;
    Facts: ICubeCreatorFacts;
    Dims: ICubeCreatorDimensions;
    Dim: IDimensionModel;
    CreatorDim1, CreatorDim2: ICubeCreatorDimension;
    AdditionalDims: ICubeCreatorAdditionalFields;
    CrInfo: IMetabaseObjectCreateInfo;
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("Dim1");
    //Dimension that is based on the current dictionary
    Dim := MB.ItemById("CALENDAR").Bind As IDimensionModel;
    CreatorDim2 := Dims.Add(Dim);
    //Index of the block, by which binding to table fields is executed
    CreatorDim2.Index := Dim.Blocks.Item("MONTHS").Indexes.PrimaryIndex;
    //Cube facts
    Facts := CCreator.Facts;
    Facts.Add("Fact1");
    Facts.Add("Fact2");
    //Information about creating a repository object
    CrInfo := MB.CreateCreateInfo;
    CrInfo.Parent := MB.ItemById("F_CUBES");
    CrInfo.Permanent := True;
    //Additional fields
    AdditionalDims := CCreator.AdditionalFields;
    AdditionalDims.Add("TERRID", DbDataType.Integer);
    //Cube creation
    CCreator.CreateCube(CrInfo);
End Sub UserProc;

The cube creator is initialized on executing the example. A collection of dimensions is formed for cube creation, two facts are created in the collection of facts. A cube is created in the selected folder. On executing the CreateCube method the table is formed, in which the facts values are stored. Dimension and fact bindings are set up for this table. The TERRID field is also created in the table that will not have any binding in the cube.

See also:

ICubeCreator