IVirtualCube.Compounds

Syntax

Compounds: IVirtualCubeCompounds;

Description

The Compounds property returns the collection of composite structures of virtual cube.

Comments

Composite structures are projected in composite dictionaries in the results of virtual cube calculation. Use the ICubeExecuteResult interface to get results of cube calculation. To work with composite dimensions, use ICompoundDimension.

Example

Executing the example requires that the repository contains a time series database with the FC_FIRST and FC_SECOND identifiers. Also, add links to the Metabase, Cubes system assemblies.

    Sub UserProc;
    Var
        Mb: IMetabase;
        Ci: IMetabaseObjectCreateInfo;
        VirtCube: IVirtualCube;
        SourceInst: ICubeInstance;
        Dest: ICubeInstanceDestination;
        VirtCompounds: IVirtualCubeCompounds;
        VCompound: IVirtualCubeCompound;
        i: Integer;
    Begin
        Mb := MetabaseClass.Active;
        Ci := Mb.CreateCreateInfo;
        Ci.ClassId := MetabaseObjectClass.KE_CLASS_EXPRESSREPORT;
        Ci.Permanent := False;
    // Create a virtual cube
        Ci.ClassId := MetabaseObjectClass.KE_CLASS_VIRTUALCUBE;
        VirtCube := Mb.CreateObject(Ci).Edit As IVirtualCube;
    // Add the 1st time series database to virtual cube 
        SourceInst := Mb.ItemById("FC_FIRST").Open(NullAs ICubeInstance;
        Dest := SourceInst.Destinations.DefaultDestination;
        VirtCube.Sources.Add(Dest.DestinationModel);
    // Add the 2nd time series database to virtual cube 
        SourceInst := Mb.ItemById("FC_SECOND").Open(NullAs ICubeInstance;
        Dest := SourceInst.Destinations.DefaultDestination;
        VirtCube.Sources.Add(Dest.DestinationModel);
    // Save virtual cube
        (VirtCube As IMetabaseObject).Save;
    // Display information about composite dictionaries
        VirtCompounds := VirtCube.Compounds;
        For i := 0 To VirtCompounds.Count - 1 Do
            VCompound := VirtCompounds.Item(i);
            Debug.WriteLine(i.ToString + "- Composite dictionary: ");
            Select Case VCompound.Predefined
                Case VirtualCubeCompoundPredeterminedType.Custom: Debug.WriteLine(    custom);
                Case VirtualCubeCompoundPredeterminedType.Fact: Debug.WriteLine(    facts);
                Case VirtualCubeCompoundPredeterminedType.Calendar: Debug.WriteLine(    calendar);
                Case VirtualCubeCompoundPredeterminedType.Scenario: Debug.WriteLine(    scenario);
            End Select;
            Debug.WriteLine(    active:  + VCompound.Active.ToString);
            Debug.WriteLine("    dimension identifier: " + (VCompound.Dimension As IMetabaseObject).Id);
        End For;
    End Sub UserProc;

After executing the example a virtual cube is created based on these two time series databases. The console window displays information about composite dictionaries of virtual cube.

See also:

IVirtualCube