ICubeMetaLoader.DuplicateCheck

Fore Syntax

DuplicateCheck: CubeLoadDuplicateCheckSet;

Fore.NET Syntax

DuplicateCheck: Prognoz.Platform.Interop.Cubes.CubeLoadDuplicateCheckSet;

Description

The DuplicateCheck property determines a mode of excluding duplicate values.

Comments

To select the time series loading mode, use the ICubeMetaLoader.LoadType property.

Fore Example

Executing the example requires a time series database with the TSDB_IMP identifier containing mandatory custom attributes with the CITY and INDICATOR identifiers. These attributes must be links to the dictionary. The child container of time series database must have several scenarios.

The file system must have the D:\res_export.txt file with data.

Contents of the res_export.txt file

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

<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;TextProvider:&nbsp;IDtTextProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Mb:&nbsp;IMetabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDBObj:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDB:&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Attr:&nbsp;IMetaAttributes;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo:&nbsp;IMetabaseObjectCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Obj:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader:&nbsp;ICubeMetaLoader;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Bindings:&nbsp;ICubeMetaLoaderBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM:&nbsp;IDimensionModel;<br /> </font><font color="#008080">Begin</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;data&nbsp;source&nbsp;to&nbsp;import&nbsp;from&nbsp;text&nbsp;file<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;TextProvider&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtTextProvider.Create;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.File&nbsp;:=&nbsp;</font><font color="#800000">&quot;D:\res_export.txt&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.FormatType&nbsp;:=&nbsp;DtTextFormatType.Delimited;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.DelimitedColumnDelimiter&nbsp;:=&nbsp;</font><font color="#800000">&quot;;&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.DelimitedTextQualifier&nbsp;:=&nbsp;</font><font color="#800000">&quot;&quot;&quot;&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.Encoding&nbsp;:=&nbsp;</font><font color="#800000">&quot;WIN&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.RangeHasHeader&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.Open;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;time series database<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Mb&nbsp;:=&nbsp;MetabaseClass.Active;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDBObj&nbsp;:=&nbsp;Mb.ItemById(</font><font color="#800000">&quot;TSDB_IMP&quot;</font><font color="#000000">).Bind;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDB&nbsp;:=&nbsp;TSDBObj&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Attr&nbsp;:=&nbsp;TSDB.Facts.Attributes;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;object&nbsp;to&nbsp;load&nbsp;time&nbsp;series<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;CrInfo&nbsp;:=&nbsp;Mb.CreateCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.ClassId&nbsp;:=&nbsp;MetabaseObjectClass.KE_CLASS_CUBEMETALOADER;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Parent&nbsp;:=&nbsp;TSDBObj;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Id&nbsp;:=&nbsp;Mb.GenerateId(</font><font color="#800000">&quot;CUBEMETALOADER&quot;</font><font color="#000000">,&nbsp;TSDBObj.Key);<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Permanent&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Obj&nbsp;:=&nbsp;Mb.CreateObject(CrInfo).Edit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader&nbsp;:=&nbsp;Obj&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;ICubeMetaLoader;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.Data&nbsp;:=&nbsp;TextProvider&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDatasetDataProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;consumer<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.Rubricator&nbsp;:=&nbsp;TSDB;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;loading&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.ImportObjectKey&nbsp;:=&nbsp;Obj.Key;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.NewRevisionName&nbsp;:=&nbsp;</font><font color="#800000">&quot;Update&nbsp;data&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.LoadType&nbsp;:=&nbsp;CubeMetaLoaderLoadType.CreateAndUpdate;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.LoadMode&nbsp;:=&nbsp;CubeLoadClearMode.DataAndMetadata;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.DuplicateCheck&nbsp;:=&nbsp;CubeLoadDuplicateCheckSet.ValueAttribute&nbsp;</font><font color="#008080">Or</font><font color="#000000">&nbsp;CubeLoadDuplicateCheckSet.Value;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;scenario&nbsp;to&nbsp;which&nbsp;data&nbsp;will&nbsp;be loaded<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.ScenarioKey&nbsp;:=&nbsp;(TSDB.ModelSpace&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IMsModelSpace).ScenarioTree.Item(</font><font color="#008000">0</font><font color="#000000">).Key;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;attribute&nbsp;binding<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Bindings&nbsp;:=&nbsp;Loader.Bindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;calendar&nbsp;binding<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Calendar;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.ByColumns&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.CalendarDateFormat&nbsp;:=&nbsp;</font><font color="#800000">&quot;$Year$&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.CalendarOptions.Levels&nbsp;:=&nbsp;DimCalendarLevelSet.Year;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Year&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;of the&nbsp;Measurement&nbsp;Units&nbsp;(UNIT) attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Unit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.ConstValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldValue&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;UNIT&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM&nbsp;:=&nbsp;Attr.FindById(</font><font color="#800000">&quot;UNIT&quot;</font><font color="#000000">).ValuesObject.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Dimension&nbsp;:=&nbsp;DimM;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Index&nbsp;:=&nbsp;DimM.Indexes.Item(</font><font color="#008000">0</font><font color="#000000">).Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;of the&nbsp;Cities&nbsp;(CITY) attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Attribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;CITY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;CITY_KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM&nbsp;:=&nbsp;Attr.FindById(</font><font color="#800000">&quot;CITY&quot;</font><font color="#000000">).ValuesObject.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Dimension&nbsp;:=&nbsp;DimM;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Index&nbsp;:=&nbsp;DimM.Indexes.Item(</font><font color="#008000">0</font><font color="#000000">).Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.NameAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;NAME&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;of the&nbsp;Indicators&nbsp;(INDICATOR) attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Attribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;INDICATOR_KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM&nbsp;:=&nbsp;Attr.FindById(</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">).ValuesObject.Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Dimension&nbsp;:=&nbsp;DimM;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Index&nbsp;:=&nbsp;DimM.Indexes.Item(</font><font color="#008000">0</font><font color="#000000">).Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.NameAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;NAME&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;to&nbsp;import&nbsp;series observation values<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Value;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Value&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Load&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.LoadData;<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 the data from the "D:\res_export.txt" file will be imported to the time series database for the first scenario, and duplicate data will be excluded.

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.Ms;
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;TextProvider:&nbsp;IDtTextProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Mb:&nbsp;IMetabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDBObj:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDB:&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Attr:&nbsp;IMetaAttributes;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo:&nbsp;IMetabaseObjectCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Obj:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader:&nbsp;ICubeMetaLoader;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Bindings:&nbsp;ICubeMetaLoaderBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM:&nbsp;IDimensionModel;<br /> </font><font color="#008080">Begin</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a data source&nbsp;to&nbsp;import&nbsp;from&nbsp;text&nbsp;file<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;TextProvider&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtTextProvider.Create();<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.File&nbsp;:=&nbsp;</font><font color="#800000">&quot;D:\res_export.txt&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.FormatType&nbsp;:=&nbsp;DtTextFormatType.tftDelimited;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.DelimitedColumnDelimiter&nbsp;:=&nbsp;</font><font color="#800000">&quot;;&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.DelimitedTextQualifier&nbsp;:=&nbsp;</font><font color="#800000">&quot;&quot;&quot;&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.Encoding&nbsp;:=&nbsp;</font><font color="#800000">&quot;WIN&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.RangeHasHeader&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TextProvider.Open();<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;time&nbsp;series&nbsp;database<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Mb&nbsp;:=&nbsp;Params.Metabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDBObj&nbsp;:=&nbsp;Mb.ItemById[</font><font color="#800000">&quot;TSDB_IMP&quot;</font><font color="#000000">].Bind();<br /> &nbsp;&nbsp;&nbsp;&nbsp;TSDB&nbsp;:=&nbsp;TSDBObj&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Attr&nbsp;:=&nbsp;TSDB.Facts.Attributes;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;an object&nbsp;to&nbsp;load&nbsp;time&nbsp;series<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;CrInfo&nbsp;:=&nbsp;Mb.CreateCreateInfo();<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.ClassId&nbsp;:=&nbsp;MetabaseObjectClass.KE_CLASS_CUBEMETALOADER&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;integer;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Parent&nbsp;:=&nbsp;TSDBObj;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Id&nbsp;:=&nbsp;Mb.GenerateId(</font><font color="#800000">&quot;CUBEMETALOADER&quot;</font><font color="#000000">,&nbsp;TSDBObj.Key);<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Permanent&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Obj&nbsp;:=&nbsp;Mb.CreateObject(CrInfo).Edit();<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader&nbsp;:=&nbsp;Obj&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;ICubeMetaLoader;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.Data&nbsp;:=&nbsp;TextProvider&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDatasetDataProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Determine&nbsp;data&nbsp;consumer<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.Rubricator&nbsp;:=&nbsp;TSDB;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;loading&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.ImportObjectKey&nbsp;:=&nbsp;Obj.Key;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.NewRevisionName&nbsp;:=&nbsp;</font><font color="#800000">&quot;Update&nbsp;data&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.LoadType&nbsp;:=&nbsp;CubeMetaLoaderLoadType.cmlltCreateAndUpdate;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.LoadMode&nbsp;:=&nbsp;CubeLoadClearMode.clcmDataAndMetadata;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Loader.DuplicateCheck&nbsp;:=&nbsp;CubeLoadDuplicateCheckSet.cldcValueAttribute&nbsp;</font><font color="#008080">Or</font><font color="#000000">&nbsp;CubeLoadDuplicateCheckSet.cldcValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;scenario&nbsp;to&nbsp;which&nbsp;data&nbsp;will be&nbsp;loaded<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.ScenarioKey&nbsp;:=&nbsp;(TSDB.ModelSpace&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IMsModelSpace).ScenarioTree.Item[</font><font color="#008000">0</font><font color="#000000">].Key&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;integer;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;attribute&nbsp;binding<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Bindings&nbsp;:=&nbsp;Loader.Bindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;calendar&nbsp;binding<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtCalendar;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.ByColumns&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.CalendarDateFormat&nbsp;:=&nbsp;</font><font color="#800000">&quot;$Year$&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.CalendarOptions.Levels&nbsp;:=&nbsp;DimCalendarLevelSet.dclsYear;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftName;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Year&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;of the&nbsp;Measurement&nbsp;Units&nbsp;(UNIT) attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtUnit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftConstValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldValue&nbsp;:=&nbsp;</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;UNIT&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM&nbsp;:=&nbsp;Attr.FindById(</font><font color="#800000">&quot;UNIT&quot;</font><font color="#000000">).ValuesObject.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Dimension&nbsp;:=&nbsp;DimM;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Index&nbsp;:=&nbsp;DimM.Indexes.Item[</font><font color="#008000">0</font><font color="#000000">].Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;of the&nbsp;Cities&nbsp;(CITY) attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtAttribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;CITY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftName;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;CITY_KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM&nbsp;:=&nbsp;Attr.FindById(</font><font color="#800000">&quot;CITY&quot;</font><font color="#000000">).ValuesObject.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Dimension&nbsp;:=&nbsp;DimM;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Index&nbsp;:=&nbsp;DimM.Indexes.Item[</font><font color="#008000">0</font><font color="#000000">].Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.NameAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;NAME&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;of the&nbsp;Factors&nbsp;(INDICATOR) attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtAttribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftName;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;INDICATOR_KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimM&nbsp;:=&nbsp;Attr.FindById(</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">).ValuesObject.Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Dimension&nbsp;:=&nbsp;DimM;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Index&nbsp;:=&nbsp;DimM.Indexes.Item[</font><font color="#008000">0</font><font color="#000000">].Id;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.NameAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;NAME&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;binding&nbsp;to&nbsp;import&nbsp;series&nbsp;observation&nbsp;values<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Binding&nbsp;:=&nbsp;Bindings.Add();<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.cmlbtValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.cmlftName;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Binding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Value&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Load&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Loader.LoadData();<br /> </font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">Sub</font><font color="#000000">;</font>

See also:

ICubeMetaLoader