ICubeMetaLoaderLogEntry.DestField

Fore Syntax

DestField: Integer;

Fore.NET Syntax

DestField: integer;

Description

The DestField property returns the number of the field in the data consumer.

Comments

To get the number of the corresponding field in the data source, use the ICubeMetaLoaderLogEntry.SourceField property.

Fore Example

Executing the example requires that the repository contains a time series database with the TSDB_UNPIVOT identifier containing time series attributes with the COUNTRY and INDICATOR identifiers. The COUNTRY attribute must be a link to MDM dictionary, and the INDICATOR attribute must be a link to MDM table dictionary.

The file system must contain the file D:\Indicator_Data.xlsx containing a data sheet named Sheet1.

Add links to the Cubes, Db, Dimensions, Dt, Metabase, Rds system assemblies.

The contents of the Sheet1 sheet in the file D:\Indicator_Data.xlsx

<font color="#008080">Sub</font><font color="#000000">&nbsp;UserProc;<br /> </font><font color="#008080">Var</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;mb:&nbsp;IMetabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;desc:&nbsp;IMetabaseObjectDescriptor;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importObject:&nbsp;IImportRequestDefinition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo:&nbsp;IMetabaseObjectCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;params:&nbsp;IImportRequestProviderParams;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Bindings:&nbsp;ICubeMetaLoaderBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary:&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;excel:&nbsp;IDtExcelProviderEx;<br /> &nbsp;&nbsp;&nbsp;&nbsp;instance:&nbsp;IImportRequestInstance;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importResult:&nbsp;IImportRequestResult;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Log:&nbsp;ICubeMetaLoaderLog;<br /> &nbsp;&nbsp;&nbsp;&nbsp;LogStr:&nbsp;String;<br /> &nbsp;&nbsp;&nbsp;&nbsp;count,&nbsp;i:&nbsp;Integer;<br /> &nbsp;&nbsp;&nbsp;&nbsp;entry:&nbsp;ICubeMetaLoaderLogEntry;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rub:&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Unpivot:&nbsp;IDtUnpivotProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Attributes:&nbsp;IMetaAttributes;<br /> </font><font color="#008080">Begin</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;MB&nbsp;:=&nbsp;MetabaseClass.Active;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;and&nbsp;clear&nbsp;time&nbsp;series&nbsp;database<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;mb.ItemById(</font><font color="#800000">&quot;TSDB_UNPIVOT&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;rub&nbsp;:=&nbsp;desc.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rub.Truncate;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;an object&nbsp;to&nbsp;import&nbsp;time&nbsp;series<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;createInfo&nbsp;:=&nbsp;mb.CreateCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.ClassId&nbsp;:=&nbsp;MetabaseObjectClass.KE_CLASS_IMPORTREQUEST;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;object&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;createInfo.Name&nbsp;:=&nbsp;</font><font color="#800000">&quot;Import&nbsp;from&nbsp;file&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.KeepEdit&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.Permanent&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.Parent&nbsp;:=&nbsp;desc;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importObject&nbsp;:=&nbsp;mb.CreateObject(createInfo)&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IImportRequestDefinition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;source&nbsp;type&nbsp;from&nbsp;which&nbsp;data&nbsp;will be&nbsp;imported<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importObject.SourceType&nbsp;:=&nbsp;ImportRequestSourceType.Provider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;time&nbsp;series&nbsp;databse&nbsp;to&nbsp;which&nbsp;data&nbsp;will be&nbsp;imported<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importObject.DestinationRubricator&nbsp;:=&nbsp;desc.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;import&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;params&nbsp;:=&nbsp;importObject.ProviderParams;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Deselect&nbsp;constraint&nbsp;to&nbsp;maximum&nbsp;number&nbsp;of errors&nbsp;in&nbsp;report&nbsp;about&nbsp;data&nbsp;import<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;(params&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;ICubeMetaLoader).Log.MaxErrors&nbsp;:=&nbsp;-</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;attribute&nbsp;bindings<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Bindings&nbsp;:=&nbsp;params.Bindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;time series&nbsp;attributes;<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Attributes&nbsp;:=&nbsp;rub.Facts.Attributes;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dictionary&nbsp;to&nbsp;which&nbsp;the COUNTRY attribute is referenced<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;Attributes.FindById(</font><font color="#800000">&quot;COUNTRY&quot;</font><font color="#000000">).ValuesObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary&nbsp;:=&nbsp;desc.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;binding&nbsp;for&nbsp;the&nbsp;COUNTRY attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Attribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;COUNTRY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Dimension&nbsp;:=&nbsp;rdsDictionary&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.KeyAttribute&nbsp;:=&nbsp;rdsDictionary.Attributes.Key.Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Index&nbsp;:=&nbsp;rdsDictionary.UniqueKeys.Item(</font><font color="#008000">0</font><font color="#000000">).Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;that&nbsp;data&nbsp;for&nbsp;attribute&nbsp;will&nbsp;be taken&nbsp;by&nbsp;filed number&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Index;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;filed&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;0&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dictionary&nbsp;to&nbsp;which&nbsp;references&nbsp;the&nbsp;INDICATOR attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;Attributes.FindById(</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">).ValuesObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary&nbsp;:=&nbsp;desc.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;binding&nbsp;for&nbsp;the&nbsp;INDICATOR attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Attribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Dimension&nbsp;:=&nbsp;rdsDictionary&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.KeyAttribute&nbsp;:=&nbsp;rdsDictionary.Attributes.Key.Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Index&nbsp;:=&nbsp;rdsDictionary.UniqueKeys.Item(</font><font color="#008000">1</font><font color="#000000">).Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;that&nbsp;data&nbsp;for&nbsp;the&nbsp;attribute&nbsp;will&nbsp;be taken&nbsp;by field&nbsp;number&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Index;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;field&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;1&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dictionary&nbsp;to&nbsp;which&nbsp;references&nbsp;the&nbsp;UNIT attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;Attributes.FindById(</font><font color="#800000">&quot;UNIT&quot;</font><font color="#000000">).ValuesObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary&nbsp;:=&nbsp;desc.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;binding&nbsp;for&nbsp;the&nbsp;UNIT attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Unit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Dimension&nbsp;:=&nbsp;rdsDictionary&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.KeyAttribute&nbsp;:=&nbsp;rdsDictionary.Attributes.Key.Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Index&nbsp;:=&nbsp;rdsDictionary.UniqueKeys.Item(</font><font color="#008000">0</font><font color="#000000">).Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;that&nbsp;specified&nbsp;value&nbsp;will&nbsp;be taken&nbsp;as&nbsp;attribute&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.ConstValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;attribute&nbsp;value<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldValue&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;Variant;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;binding&nbsp;for&nbsp;calendar<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Calendar;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.ByColumns&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.CalendarDateFormatEx(DimCalendarLevel.Year)&nbsp;:=&nbsp;</font><font color="#800000">&quot;$Year$&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.CalendarOptions.Levels&nbsp;:=&nbsp;DimCalendarLevelSet.Year;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;that&nbsp;data&nbsp;for&nbsp;calendar&nbsp;will&nbsp;be&nbsp;taken&nbsp;by field&nbsp;number&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Index;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;field&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;2&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;binding&nbsp;for&nbsp;time&nbsp;series&nbsp;variables<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Value;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;that&nbsp;values&nbsp;will be taken by&nbsp;field&nbsp;number&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Index;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;field&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;3&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Try</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtExcelProviderEx.Create;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;parameters&nbsp;of the file&nbsp;from&nbsp;which&nbsp;data&nbsp;will be&nbsp;imported<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel.File&nbsp;:=&nbsp;</font><font color="#800000">&quot;D:\Indicator_Data.xlsx&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel.Sheet&nbsp;:=&nbsp;</font><font color="#800000">&quot;Лист1&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel.Format&nbsp;:=&nbsp;</font><font color="#800000">&quot;XLSX&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Excel.HasHeader&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;area&nbsp;location&nbsp;in&nbsp;source file<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtUnpivotProvider.Create;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.Provider&nbsp;:=&nbsp;Excel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.LeftEnd&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataWidth&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataTop&nbsp;:=&nbsp;</font><font color="#008000">3</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataBottom&nbsp;:=&nbsp;</font><font color="#008000">5</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.HeadBottom&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataRight&nbsp;:=&nbsp;</font><font color="#008000">8</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.HeadColumn&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.LeftBegin&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.HeadTop&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Load&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.Open;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count&nbsp;:=&nbsp;Unpivot.Fields.Count;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;importObject.ProviderParams.Provider&nbsp;:=&nbsp;Unpivot&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDatasetDataProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instance&nbsp;:=&nbsp;(importObject&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IMetabaseObject).Open(</font><font color="#008080">Null</font><font color="#000000">)&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IImportRequestInstance;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Instance.LoadData;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;report&nbsp;about&nbsp;data&nbsp;loading<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;importResult&nbsp;:=&nbsp;instance.ImportResult;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log&nbsp;:=&nbsp;importResult.Log;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count&nbsp;:=&nbsp;Log.Count;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Display&nbsp;report&nbsp;to&nbsp;console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Number&nbsp;of records&nbsp;&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Count.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;i&nbsp;:=&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">To</font><font color="#000000">&nbsp;Count&nbsp;-&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Entry&nbsp;:=&nbsp;Log.Item(i);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LogStr&nbsp;:=&nbsp;i.ToString&nbsp;+&nbsp;</font><font color="#800000">&quot;:&nbsp;&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;(Entry.IsError&nbsp;?&nbsp;</font><font color="#800000">&quot;Ошибка:&nbsp;&quot;</font><font color="#000000">&nbsp;:(Entry.IsMessage&nbsp;?&nbsp;</font><font color="#800000">&quot;Сообщение:&nbsp;&quot;</font><font color="#000000">&nbsp;:&nbsp;</font><font color="#800000">&quot;Warning:&nbsp;&quot;</font><font color="#000000">))&nbsp;+<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;Entry.ErrorMessage;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(LogStr);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.Indent;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Record&nbsp;number&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.RecordNumber.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Record&nbsp;value&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.ValueRecordNumber.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Field&nbsp;in&nbsp;data&nbsp;source&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.Field);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Number&nbsp;of record&nbsp;in&nbsp;data&nbsp;source&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.SourceRecord.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Number&nbsp;of field&nbsp;in&nbsp;data&nbsp;source&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.SourceField.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Number&nbsp;of record&nbsp;in&nbsp;data&nbsp;consumer&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.DestRecord.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Number&nbsp;of field&nbsp;in&nbsp;data&nbsp;consumer&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.DestField.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.Unindent;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">For</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Except</font><font color="#000000">&nbsp;</font><font color="#008080">On</font><font color="#000000">&nbsp;e:&nbsp;Exception&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(e.Message);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Finally</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">Try</font><font color="#000000">;<br /> </font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">Sub</font><font color="#000000">&nbsp;UserProc;</font>

After executing the example data is imported from the file D:\Indicator_Data.xlsx into the TSDB_UNPIVOT time series database. Import errors are displayed in the console window.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Db;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Dt;
Imports Prognoz.Platform.Interop.Rds;

<font color="#008080">Public</font><font color="#000000">&nbsp;</font><font color="#008080">Shared</font><font color="#000000">&nbsp;</font><font color="#008080">Sub</font><font color="#000000">&nbsp;Main(Params:&nbsp;StartParams);<br /> </font><font color="#008080">Var</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;mb:&nbsp;IMetabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;desc:&nbsp;IMetabaseObjectDescriptor;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importObject:&nbsp;IImportRequestDefinition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo:&nbsp;IMetabaseObjectCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ImportParams:&nbsp;IImportRequestProviderParams;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Bindings:&nbsp;ICubeMetaLoaderBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary:&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;excel:&nbsp;IDtExcelProviderEx;<br /> &nbsp;&nbsp;&nbsp;&nbsp;instance:&nbsp;IImportRequestInstance;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importResult:&nbsp;IImportRequestResult;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Log:&nbsp;ICubeMetaLoaderLog;<br /> &nbsp;&nbsp;&nbsp;&nbsp;LogStr:&nbsp;String;<br /> &nbsp;&nbsp;&nbsp;&nbsp;count,&nbsp;i:&nbsp;Integer;<br /> &nbsp;&nbsp;&nbsp;&nbsp;entry:&nbsp;ICubeMetaLoaderLogEntry;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rub:&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Unpivot:&nbsp;IDtUnpivotProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Attributes:&nbsp;IMetaAttributes;<br /> </font><font color="#008080">Begin</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;MB&nbsp;:=&nbsp;Params.Metabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;and&nbsp;clear&nbsp;time&nbsp;series&nbsp;database<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;mb.ItemById[</font><font color="#800000">&quot;TSDB_UNPIVOT&quot;</font><font color="#000000">];<br /> &nbsp;&nbsp;&nbsp;&nbsp;rub&nbsp;:=&nbsp;desc.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rub.Truncate();<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;an object&nbsp;to&nbsp;import&nbsp;time series&nbsp;database<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;createInfo&nbsp;:=&nbsp;mb.CreateCreateInfo();<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.ClassId&nbsp;:=&nbsp;MetabaseObjectClass.KE_CLASS_IMPORTREQUEST&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;integer;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;object&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;createInfo.Name&nbsp;:=&nbsp;</font><font color="#800000">&quot;Import&nbsp;from&nbsp;file&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.KeepEdit&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.Permanent&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;createInfo.Parent&nbsp;:=&nbsp;desc;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importObject&nbsp;:=&nbsp;mb.CreateObject(createInfo)&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IImportRequestDefinition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;source&nbsp;type&nbsp;from&nbsp;which&nbsp;data&nbsp;will be imported<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importObject.SourceType&nbsp;:=&nbsp;ImportRequestSourceType.irstProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;time&nbsp;series&nbsp;database&nbsp;where&nbsp;data&nbsp;will&nbsp;be&nbsp;imported<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importObject.DestinationRubricator&nbsp;:=&nbsp;desc.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;import&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;ImportParams&nbsp;:=&nbsp;importObject.ProviderParams;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Remove&nbsp;a restriction&nbsp;to get&nbsp;a maximum&nbsp;number&nbsp;of errors&nbsp;in&nbsp;data&nbsp;import&nbsp;report<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;(ImportParams&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;ICubeMetaLoader).Log.MaxErrors&nbsp;:=&nbsp;-</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;attribute&nbsp;bindings<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Bindings&nbsp;:=&nbsp;ImportParams.Bindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;time&nbsp;series&nbsp;attributes;<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Attributes&nbsp;:=&nbsp;rub.Facts.Attributes;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dictionary&nbsp;to which&nbsp;refers&nbsp;the COUNTRY attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;Attributes.FindById(</font><font color="#800000">&quot;COUNTRY&quot;</font><font color="#000000">).ValuesObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary&nbsp;:=&nbsp;desc.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a binding&nbsp;for&nbsp;the COUNTRY attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtAttribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;COUNTRY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Dimension&nbsp;:=&nbsp;rdsDictionary&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.KeyAttribute&nbsp;:=&nbsp;rdsDictionary.Attributes.Key.Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Index&nbsp;:=&nbsp;rdsDictionary.UniqueKeys.Item[</font><font color="#008000">0</font><font color="#000000">].Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;data&nbsp;for&nbsp;attribute&nbsp;will&nbsp;be&nbsp;taken&nbsp;by field&nbsp;number&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftIndex;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;field&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;0&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dictionary&nbsp;to&nbsp;which&nbsp;refers&nbsp;the INDICATOR attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;Attributes.FindById(</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">).ValuesObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary&nbsp;:=&nbsp;desc.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a binding&nbsp;for&nbsp;the INDICATOR attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtAttribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Dimension&nbsp;:=&nbsp;rdsDictionary&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.KeyAttribute&nbsp;:=&nbsp;rdsDictionary.Attributes.Key.Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Index&nbsp;:=&nbsp;rdsDictionary.UniqueKeys.Item[</font><font color="#008000">1</font><font color="#000000">].Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;data&nbsp;for&nbsp;attribute&nbsp;will be&nbsp;taken&nbsp;by&nbsp;field&nbsp;number&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftIndex;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;field&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;1&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dictionary&nbsp;to&nbsp;which&nbsp;the UNIT&nbsp;attribute&nbsp;refers<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;desc&nbsp;:=&nbsp;Attributes.FindById(</font><font color="#800000">&quot;UNIT&quot;</font><font color="#000000">).ValuesObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDictionary&nbsp;:=&nbsp;desc.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDictionary;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a binding&nbsp;for&nbsp;the UNIT attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtUnit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Dimension&nbsp;:=&nbsp;rdsDictionary&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.KeyAttribute&nbsp;:=&nbsp;rdsDictionary.Attributes.Key.Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.Index&nbsp;:=&nbsp;rdsDictionary.UniqueKeys.Item[</font><font color="#008000">0</font><font color="#000000">].Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;the&nbsp;specifed&nbsp;value&nbsp;will be&nbsp;taken&nbsp;as attribute&nbsp;value<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftConstValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;attribute&nbsp;value<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldValue&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;object;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a binding&nbsp;for&nbsp;calendar<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtCalendar;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.ByColumns&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.CalendarDateFormatEx[DimCalendarLevel.dclYear]&nbsp;:=&nbsp;</font><font color="#800000">&quot;$Year$&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.CalendarOptions.Levels&nbsp;:=&nbsp;DimCalendarLevelSet.dclsYear;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;data&nbsp;for&nbsp;calendar&nbsp;will be&nbsp;taken&nbsp;by&nbsp;field&nbsp;number&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftIndex;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;field&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;2&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a binding&nbsp;for&nbsp;time&nbsp;series&nbsp;values<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;importBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Soecify&nbsp;that&nbsp;values&nbsp;will be&nbsp;taken&nbsp;by&nbsp;field&nbsp;number&nbsp;in&data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftIndex;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;field&nbsp;number<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;importBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;3&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Try</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtExcelProviderEx.Create();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;parameters&nbsp;of the file&nbsp;from&nbsp;which&nbsp;data&nbsp;will be&nbsp;imported<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel.File&nbsp;:=&nbsp;</font><font color="#800000">&quot;D:\Indicator_Data.xlsx&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel.Sheet&nbsp;:=&nbsp;</font><font color="#800000">&quot;Sheet1&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;excel.Format&nbsp;:=&nbsp;</font><font color="#800000">&quot;XLSX&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Excel.HasHeader&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;location&nbsp;of data&nbsp;areas&nbsp;in&nbsp;source file<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtUnpivotProvider.Create();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.Provider&nbsp;:=&nbsp;Excel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.LeftEnd&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataWidth&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataTop&nbsp;:=&nbsp;</font><font color="#008000">3</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataBottom&nbsp;:=&nbsp;</font><font color="#008000">5</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.HeadBottom&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.DataRight&nbsp;:=&nbsp;</font><font color="#008000">8</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.HeadColumn&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.LeftBegin&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.HeadTop&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Load&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unpivot.Open();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count&nbsp;:=&nbsp;Unpivot.Fields.Count;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;importObject.ProviderParams.Provider&nbsp;:=&nbsp;Unpivot&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDatasetDataProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instance&nbsp;:=&nbsp;(importObject&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IMetabaseObject).Open(</font><font color="#008080">Null</font><font color="#000000">)&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IImportRequestInstance;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Instance.LoadData();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;report&nbsp;about&nbsp;data&nbsp;loading<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;importResult&nbsp;:=&nbsp;instance.ImportResult;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log&nbsp;:=&nbsp;importResult.Log;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count&nbsp;:=&nbsp;Log.Count;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Display&nbsp;report&nbsp;to&nbsp;console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Number&nbsp;of records&nbsp;&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Count.ToString());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;i&nbsp;:=&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">To</font><font color="#000000">&nbsp;Count&nbsp;-&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Entry&nbsp;:=&nbsp;Log.Item[i];<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LogStr&nbsp;:=&nbsp;i.ToString()&nbsp;+&nbsp;</font><font color="#800000">&quot;:&nbsp;&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;(Entry.IsError&nbsp;?&nbsp;</font><font color="#800000">&quot;Error:&nbsp;&quot;</font><font color="#000000">&nbsp;:(Entry.IsMessage&nbsp;?&nbsp;</font><font color="#800000">&quot;Message:&nbsp;&quot;</font><font color="#000000">&nbsp;:&nbsp;</font><font color="#800000">&quot;Warning:&nbsp;&quot;</font><font color="#000000">))<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;Entry.ErrorMessage;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(LogStr);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.Indent();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Record&nbsp;number&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.RecordNumber.ToString());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Record&nbsp;value&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.ValueRecordNumber.ToString());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Field&nbsp;in&nbsp;data&nbsp;source&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.Field);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Number&nbsp;of record&nbsp;in&nbsp;data&nbsp;source&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.SourceRecord.ToString());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Field&nbsp;number&nbsp;in&nbsp;data&nbsp;source&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.SourceField.ToString());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Record&nbsp;number&nbsp;in&nbsp;data&nbsp;consumer&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.DestRecord.ToString());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Field&nbsp;number&nbsp;in&nbsp;data&nbsp;consumer&nbsp;=&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Entry.DestField.ToString());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.Unindent();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">For</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Except</font><font color="#000000">&nbsp;</font><font color="#008080">On</font><font color="#000000">&nbsp;e:&nbsp;Exception&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(e.Message);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Finally</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">Try</font><font color="#000000">;<br /> </font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">Sub</font><font color="#000000">;</font>

See also:

ICubeMetaLoaderLogEntry