ICalculatedCubeDimension.Fixed

Syntax

Fixed: Boolean;

Description

The Fixed property determines whether a dimension is fixed.

Comments

Available values:

For dimension in data sources of calculated cube to be fixed, this dimension are added into destination cube.

Fixation supposes direct correspondence between elements of source dictionary and target dictionary. Correspondence between dimension elements is set by index.

Example

Executing the example requires a calculated cube with the Calc_Cube identifier and a cube with the Cube_1 identifier, which will be added to data sources of calculated cube.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Cube: ICalculatedCube;
    Sources: ICalculatedCubeSources;
    Source: ICalculatedCubeSource;
    CubeSource: ICubeModel;
    SourceDims: ICalculatedCubeSourceDimensions;
    SourceDim, CalCubeDim: ICalculatedCubeDimension;
    CalCubeDims: ICalculatedCubeDimensions;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("Calc_Cube").Edit;
    CubeSource := MB.ItemById("Cube_1").Bind As ICubeModel;
    Cube := MObj As ICalculatedCube;
    Sources := Cube.Sources;
    //Add a source cube
    Source := Sources.Add(CubeSource.Destinations.DefaultDestination);
    //Get dimensions of source cube
    SourceDims := Source.Dimensions;
    //Get dimensions of calculated cube
    CalCubeDims := Cube.Dimensions;
    For i := 0 To SourceDims.Count - 1 Do
        SourceDim := SourceDims.Item(i);
        //If dimension already exists in calculated cube, fix it in source cube
        //If dimension is absent, add it to calculated cube and fix it
        If CalCubeDims.FindByKey((SourceDim.Dimension As IMetabaseObject).Key) <> Null Then
            SourceDim.Fixed := True;
        Else
            CalCubeDim := CalCubeDims.Add(SourceDim.Dimension);
            SourceDim.Fixed := True;
            CalCubeDim.Fixed := True;
        End If;
    End For;
    MObj.Save;
End Sub UserProc;

On executing the example the cube with the identifier Cube_1 is added into data sources of calculated cube. All dimensions of the new data source are added into destination cube and are fixed.

See also:

ICalculatedCubeDimension