ICubeCreatorField.Translations

Syntax

Translations: ICubeCreatorFieldTranslations;

Description

The Translations property returns the collection of attribute bindings with translations for source fields.

Comments

The property is used on binding the attribute of the String or Long Text type in a multilingual MDM dictionary. On working with multilingual dictionaries, the following options can be used:

Example

Executing the example requires that the repository contains a folder with the F_CUBES identifier where cubes are stored. It is also supposed to have the file C:\Data.xls, which contains columns with the following names:

Sub UserProc;
Var
    MB: IMetabase;
    Loader: ICubeLoaderFromSource;
    Provider: IDtExcelProvider;
    Bindings: ICubeLoaderDimensionBindings;
    Binding: ICubeLoaderDimensionBinding;
    Fields: ICubeCreatorFields;
    Field: ICubeCreatorField;
    FactBindings: ICubeLoaderFactBindings;
    FactBinding: ICubeLoaderFactBinding;
Begin
    MB := MetabaseClass.Active;
    //Data source for cube
    Provider := New DtExcelProvider.Create;
    Provider.DriverVersion := "Excel 8.0";
    Provider.File := "D:\Work\Data.xls";
    Provider.HasHeader := True;
    Provider.Query := "Select * From [Sheet1$]";
    //Cube data loader 
    Loader := New CubeLoaderFromSource.Create;
    Loader.Parent := MB.ItemById("CUBE_FOLDER").Bind;
    //Set up bindings of dimensions and facts
    Bindings := Loader.DimensionBindings;
    Binding := Bindings.Add("Country Name");
    Binding.AttributeId := "NAME";
    Binding.NewDictionaryName := "Country";
    Fields := Binding.Fields;
    //Translation attribute binding
    Field := Fields.Item(0);
    Field.Translations.Add(LocaleCodeID.English_UnitedStates, "Country Name En");
    //Calendar
    Binding := Bindings.AddCalendar("Date", DimCalendarLevel.Month);
    //Facts binding
    FactBindings := Loader.FactBindings;
    FactBinding := 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 when executing the example. The dimensions bindings and facts of created cube are set up according to the information about source fields. A multilingual dictionary will be created for countries. On executing the Load method a new standard cube, required dictionaries for dimensions and a table to store data will be created. The data will be imported to the created table.

See also:

ICubeCreatorField