IdAttribute: String;
The IdAttribute property determines an attribute identifier that is referred by factor.
NOTE. The property is outdated.
Executing the example requires a time series database with the OBJ_RUBRICATOR identifier and the time series export file C:\result_exp.txt. Also, an MDM repository with the MDM_REPO identifier is required. This repository must contain a dictionary with the DICT_CTR identifier.
Sub Main;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
Obj: IMetabaseObject;
ObjDesc: IMetabaseObjectDescriptor;
Loader: ICubeMetaLoader;
Bindings: ICubeMetaLoaderBindings;
Binding: ICubeMetaLoaderBinding;
RDS: IMetabaseObjectDescriptor;
TextProvider: IDtTextProvider;
Begin
MB := MetabaseClass.Active;
CrInfo := Mb.CreateCreateInfo;
CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUBEMETALOADER;
CrInfo.Parent := Mb.ItemById("OBJ_RUBRICATOR").Bind;
CrInfo.Id := Mb.GenerateId("CUBEMETALOADER", CrInfo.Parent.Key);
CrInfo.Permanent := False;
ObjDesc := Mb.CreateObject(CrInfo);
Obj := ObjDesc.Edit;
Loader := Obj As ICubeMetaLoader;
// Data source for import from text format
TextProvider := New DtTextProvider.Create;
TextProvider.File := "C:\result_exp.txt";
TextProvider.FormatType := DtTextFormatType.Delimited;
TextProvider.DelimitedColumnDelimiter := ";";
TextProvider.DelimitedTextQualifier := """";
TextProvider.Encoding := "WIN";
TextProvider.RangeHasHeader := True;
TextProvider.Open;
Loader.Data := (TextProvider As IDatasetDataProvider);
Loader.ImportObjectKey := Obj.Key;
Loader.NewRevisionName := Metaimport;
Loader.LoadType := CubeMetaLoaderLoadType.CreateAndUpdate;
Loader.Rubricator := Mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
Bindings := Loader.Bindings;
Binding := Bindings.Add;
Binding.BindingType := CubeMetaLoaderBindingType.Dimension;
Binding.Attribute := "COUNTRY";
Binding.Field := "Country";
Binding.FieldType := CubeMetaLoaderFieldType.Name;
RDS := Mb.ItemById("RDS_REPO");
Binding.Dimension := Mb.ItemByIdNamespace("DICT_CTR", RDS.Key).Bind As IDimensionModel;
Binding.Index := "IX_WEO";
Binding.KeyAttribute := "KEY";
Binding.NameAttribute := "NAME";
Binding.IdAttribute := "WEO";
Binding.CheckField := "Country";
End Sub Main;
After executing the example an object of time series import from the text file C:\result_exp.txt is created. Import binding of data, represented by reference to a dictionary, is set up in this object.
See also: