ICubeLoaderFromSource.DimensionBindings

Syntax

DimensionBindings: ICubeLoaderDimensionBindings;

Description

The DimensionBindings property returns parameters of dimension binding to data source fields.

Comments

When the Load method is executed, a separate dimension is created in the cube structure according to each binding.

Example

Executing the example requires the following objects in repository:

Also, the C:\Data.xls file is required.

Sub UserProc;
Var
    MB: IMetabase;
    Loader: ICubeLoaderFromSource;
    Provider: IDtExcelProvider;
    DimBindings: ICubeLoaderDimensionBindings;
    DimBinding: ICubeLoaderDimensionBinding;
Begin
    MB := MetabaseClass.Active;
    //Data source for cube
    Provider := New DtExcelProvider.Create;
    Provider.DriverVersion := "Excel 8.0";
    Provider.File := "C:\Data.xls";
    Provider.HasHeader := True;
    Provider.Query := "Select * From [Sheet1$]";
    //Cube data loader 
    Loader := New CubeLoaderFromSource.Create;
    Loader.Database := MB.ItemById("BD").Open(NullAs IDatabaseInstance;
    Loader.Parent := MB.ItemById("F_CUBES").Bind;
    //Binding parameters for dimensions and facts
    DimBindings := Loader.DimensionBindings;
    DimBinding := DimBindings.Add("COUNTRY");
    DimBinding.Dictionary := MB.ItemById("COUNTRY").Bind As IDimensionModel;
    DimBinding := DimBindings.AddCalendar("DATE", DimCalendarLevel.Month);
    DimBinding.Dictionary := MB.ItemById("CALENDAR").Bind As IDimensionModel;
    Loader.FactBindings.Add("VALUE");
    //Cube creation and data loading
    Loader.Load(Provider, Null);
End Sub UserProc;

The import object from Excel and the cube data loader are initialized on executing the example. The binding parameters of dimensions and facts are prepared for cube creation. Dimensions and facts are bound to the specified fields, and the current repository dictionaries are used as dimensions. When the Load method is executed, a new standard cube and a table to store data are created. The data must be imported to the created table.

See also:

ICubeLoaderFromSource