ICubeLoaderFromSource.LoadWithResult

Fore Syntax

LoadWithResult(Source: Object; CreateInfo: IMetabaseObjectCreateInfo): ICubeLoaderResult;

Fore.NET Syntax

LoadWithResult(Source: Object; CreateInfo: Prognoz.Platform.Interop.Metabase.IMetabaseObjectCreateInfo): Prognoz.Platform.Interop.Cubes.ICubeLoaderResult;

Parameters

Source. The data source described by the IDtProvider interface.

CreateInfo. Information about the created object. If information is missing or loading to the current object is executed, the Null value must be passed as a parameter.

Description

The LoadWithResult method loads data and returns loading result.

Comments

The type of created object determines value of the ICubeLoaderFromSource.Type property.

Fore Example

Executing the example requires the following in the repository:

  1. Folder with the TSDB_FOLDER identifier.

  2. MDM repository with the RDS_LOAD identifier.

  3. Table MDM dictionary with the CITY_DICT identifier. This dictionary must be outside the MDM repository. The dictionary must also contain a unique index with the UINDEX identifier. This index must include only one attribute with the NAME identifier. The attribute contains names of dictionary elements. The dictionary must contain the following elements:

The file system must contain the C:\result_exp.txt file with data.

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

Contents of the C:\result_exp.txt file

<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;parent:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDatabase:&nbsp;IRdsDatabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;loader:&nbsp;ICubeLoaderFromSource;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimBindings:&nbsp;ICubeLoaderDimensionBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;bind:&nbsp;ICubeLoaderDimensionBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimModel:&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Calend:&nbsp;ICubeLoaderDimensionBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DateConv:&nbsp;IDateConverter;<br /> &nbsp;&nbsp;&nbsp;&nbsp;creator:&nbsp;IDtObjectCreator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;prov:&nbsp;IDtTextProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Result:&nbsp;ICubeLoaderResult;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Object:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;List,&nbsp;Arr:&nbsp;IArrayList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Item:&nbsp;Variant;<br /> &nbsp;&nbsp;&nbsp;&nbsp;i:&nbsp;Integer;<br /> </font><font color="#008080">Begin</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;current&nbsp;repository<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;mb&nbsp;:=&nbsp;MetabaseClass.Active;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;the&nbsp;TSDB_FOLDER&nbsp;where&nbsp;time&nbsp;series&nbsp;database<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;will&nbsp;be&nbsp;created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;parent&nbsp;:=&nbsp;mb.ItemById(</font><font color="#800000">&quot;TSDB_FOLDER&quot;</font><font color="#000000">).Bind;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;MDM&nbsp;repository<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;rdsDatabase&nbsp;:=&nbsp;mb.ItemById(</font><font color="#800000">&quot;RDS_LOAD&quot;</font><font color="#000000">).Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDatabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;object&nbsp;to&nbsp;load&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;CubeLoaderFromSource.Create;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;an MDM&nbsp;repository&nbsp;which&nbsp;will&nbsp;be used&nbsp;on&nbsp;loading<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.RdsDatabase&nbsp;:=&nbsp;rdsDatabase.Open(</font><font color="#008080">Null</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;time&nbsp;series&nbsp;database&nbsp;will&nbsp;be created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;for&nbsp;loaded&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.Type&nbsp;:=&nbsp;CubeLoaderType.Rubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;folder&nbsp;where&nbsp;time&nbsp;series&nbsp;database&nbsp;will be&nbsp;created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.Parent&nbsp;:=&nbsp;parent;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dimension&nbsp;bindings&nbsp;to&nbsp;data&nbsp;source&nbsp;fields<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DimBindings&nbsp;:=&nbsp;loader.DimensionBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;binding&nbsp;for&nbsp;the CITY field<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;bind&nbsp;:=&nbsp;DimBindings.Add(</font><font color="#800000">&quot;CITY&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;the field&nbsp;will&nbsp;correspond &nbsp;to dimension<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;based&nbsp;on&nbsp;the CITY_DICT MDM dictionary<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DimModel&nbsp;:=&nbsp;mb.ItemById(</font><font color="#800000">&quot;CITY_DICT&quot;</font><font color="#000000">).Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;bind.Dictionary&nbsp;:=&nbsp;DimModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;index&nbsp;by&nbsp;which&nbsp;binding&nbsp;is&nbsp;created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;bind.Index&nbsp;:=&nbsp;DimModel.Indexes.FindById(</font><font color="#800000">&quot;UINDEX&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;attribute&nbsp;identifier&nbsp;which&nbsp;is used&nbsp;to build&nbsp;index<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;bind.AttributeId&nbsp;:=&nbsp;</font><font color="#800000">&quot;NAME&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;binding&nbsp;for&nbsp;the INDICATOR field.<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Dictionary&nbsp;to&nbsp;create&nbsp;a dimension&nbsp;corresponding&nbsp;to the&nbsp;field<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;will&nbsp;be created&nbsp;automatically&nbsp;in&nbsp;the MDM&nbsp;repository&nbsp;«RDS_LOAD»<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DimBindings.Add(</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;binding&nbsp;for&nbsp;calendar&nbsp;dimension<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Calend&nbsp;:=&nbsp;DimBindings.AddCalendar(</font><font color="#800000">&quot;Year&quot;</font><font color="#000000">,&nbsp;DimCalendarLevel.Year);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;object&nbsp;to&nbsp;parse&nbsp;dates&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DateConv&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DateConverter.Create;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;data&nbsp;format<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DateConv.CalendarDateFormat&nbsp;:=&nbsp;</font><font color="#800000">&quot;$YEAR$&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DateConv.ConvertShortYear&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;created&nbsp;object&nbsp;to&nbsp;calendar&nbsp;dimension&nbsp;binding<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Calend.Converter&nbsp;:=&nbsp;DateConv;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;binding&nbsp;for&nbsp;data&nbsp;source&nbsp;values<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.FactBindings.Add(</font><font color="#800000">&quot;Value&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;an object&nbsp;to&nbsp;work&nbsp;with&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;creator&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtObjectCreator.Create;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a text&nbsp;data&nbsp;source&nbsp;from&nbsp;file<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;prov&nbsp;:=&nbsp;creator.CreateDtObjectFromFile(</font><font color="#800000">&quot;C:\result_exp.txt&quot;</font><font color="#000000">)&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDtTextProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;field&nbsp;delimiter&nbsp;used&nbsp;in&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;prov.DelimitedColumnDelimiter&nbsp;:=&nbsp;</font><font color="#800000">&quot;;&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Load&nbsp;data&nbsp;and&nbsp;process&nbsp;loading&nbsp;result<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Result&nbsp;:=&nbsp;loader.LoadWithResult(prov,&nbsp;</font><font color="#008080">Null</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;object&nbsp;to&nbsp;which&nbsp;data&nbsp;was&nbsp;loaded<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;:=&nbsp;Result.Object;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Display&nbsp;object information&nbsp;in&nbsp;console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Name&nbsp;and&nbsp;identifier&nbsp;of created&nbsp;time&nbsp;series&nbsp;database:&nbsp;&quot;</font><font color="#000000">&nbsp;+<br /> &nbsp;&nbsp;&nbsp;&nbsp;Object.Name&nbsp;+&nbsp;</font><font color="#800000">&quot;(&quot;</font><font color="#000000">&nbsp;+&nbsp;Object.Id&nbsp;+&nbsp;</font><font color="#800000">&quot;)&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;empty&nbsp;records&nbsp;and&nbsp;display&nbsp;them&nbsp;to&nbsp;the console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;:=&nbsp;Result.NullStrings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">If</font><font color="#000000">&nbsp;List.Count&nbsp;&lt;&gt;&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">Then</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Empty&nbsp;records:&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;</font><font color="#008080">Each</font><font color="#000000">&nbsp;Item&nbsp;</font><font color="#008080">In</font><font color="#000000">&nbsp;List&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Arr&nbsp;:=&nbsp;Item&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IArrayList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;Arr.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;&nbsp;&nbsp;&nbsp;&nbsp;Debug.Write(Arr.Item(i));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.Write(</font><font color="#800000">&quot;;&nbsp;&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;&quot;</font><font color="#000000">);<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">End</font><font color="#000000">&nbsp;</font><font color="#008080">If</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;duplicated&nbsp;records&nbsp;and&nbsp;display&nbsp;them&nbsp;intp&nbsp;console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;:=&nbsp;Result.DuplicatedStrings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">If</font><font color="#000000">&nbsp;List.Count&nbsp;&lt;&gt;&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">Then</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Duplicated&nbsp;records:&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;</font><font color="#008080">Each</font><font color="#000000">&nbsp;Item&nbsp;</font><font color="#008080">In</font><font color="#000000">&nbsp;List&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Arr&nbsp;:=&nbsp;Item&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IArrayList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;Arr.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;&nbsp;&nbsp;&nbsp;&nbsp;Debug.Write(Arr.Item(i));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.Write(</font><font color="#800000">&quot;;&nbsp;&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;&quot;</font><font color="#000000">);<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">End</font><font color="#000000">&nbsp;</font><font color="#008080">If</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 from the C:\result_exp.txt file is loaded to the time series database created for this purpose. Import results and identifier and name of the created time series database are output to 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.Dimensions;
Imports Prognoz.Platform.Interop.Dt;
Imports Prognoz.Platform.Interop.ForeCollections;
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;parent:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;rdsDatabase:&nbsp;IRdsDatabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;loader:&nbsp;ICubeLoaderFromSource;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimBindings:&nbsp;ICubeLoaderDimensionBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;bind:&nbsp;ICubeLoaderDimensionBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DimModel:&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Calend:&nbsp;ICubeLoaderDimensionBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DateConv:&nbsp;IDateConverter;<br /> &nbsp;&nbsp;&nbsp;&nbsp;creator:&nbsp;IDtObjectCreator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;prov:&nbsp;IDtTextProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Result:&nbsp;ICubeLoaderResult;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Object:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;List,&nbsp;Arr:&nbsp;IArrayList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Item:&nbsp;object;<br /> &nbsp;&nbsp;&nbsp;&nbsp;i:&nbsp;Integer;<br /> </font><font color="#008080">Begin</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;current&nbsp;repository<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;mb&nbsp;:=&nbsp;Params.Metabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;the&nbsp;TSDB_FOLDER folder&nbsp;where&nbsp;time&nbsp;series&nbsp;database<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;will&nbsp;be&nbsp;created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;parent&nbsp;:=&nbsp;mb.ItemById[</font><font color="#800000">&quot;TSDB_FOLDER&quot;</font><font color="#000000">].Bind();<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;MDM&nbsp;repository<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;rdsDatabase&nbsp;:=&nbsp;mb.ItemById[</font><font color="#800000">&quot;RDS_LOAD&quot;</font><font color="#000000">].Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRdsDatabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;an object&nbsp;to&nbsp;load&nbsp;data<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;CubeLoaderFromSource.Create();<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Display&nbsp;MDM&nbsp;repository&nbsp;that&nbsp;will&nbsp;be used&nbsp;on&nbsp;loading<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.RdsDatabase&nbsp;:=&nbsp;rdsDatabase.Open(</font><font color="#008080">Null</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;for&nbsp;loaded&nbsp;data&nbsp;time&nbsp;series<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;database&nbsp;will be&nbsp;created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.Type&nbsp;:=&nbsp;CubeLoaderType.cltRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;folder&nbsp;where&nbsp;time&nbsp;series&nbsp;database&nbsp;will be&nbsp;created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.Parent&nbsp;:=&nbsp;parent;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;dimension&nbsp;bindings&nbsp;to&nbsp;data&nbsp;source&nbsp;fields<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DimBindings&nbsp;:=&nbsp;loader.DimensionBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;binding&nbsp;for&nbsp;the CITY field<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;bind&nbsp;:=&nbsp;DimBindings.Add(</font><font color="#800000">&quot;CITY&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;that&nbsp;the filed&nbsp;will&nbsp;correspond&nbsp;to dimension<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;based on&nbsp;the CITY_DICT MDM dictionary<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DimModel&nbsp;:=&nbsp;mb.ItemById[</font><font color="#800000">&quot;CITY_DICT&quot;</font><font color="#000000">].Bind()&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;bind.Dictionary&nbsp;:=&nbsp;DimModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;index&nbsp;by&nbsp;which&nbsp;binding&nbsp;will be&nbsp;created<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;bind.Index&nbsp;:=&nbsp;DimModel.Indexes.FindById(</font><font color="#800000">&quot;UINDEX&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;attribute&nbsp;identifier&nbsp;on&nbsp;which&nbsp;index&nbsp;is built<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;bind.AttributeId&nbsp;:=&nbsp;</font><font color="#800000">&quot;NAME&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;a binding&nbsp;for&nbsp;the INDICATOR field.<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Dictionary&nbsp;to&nbsp;create&nbsp;a dimension&nbsp;corresponding&nbsp;to this&nbsp;field<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;will&nbsp;be created&nbsp;automatically&nbsp;in&nbsp;MDM&nbsp;repository RDS_LOAD<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DimBindings.Add(</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;a binding&nbsp;for&nbsp;calendar&nbsp;dimension<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Calend&nbsp;:=&nbsp;DimBindings.AddCalendar(</font><font color="#800000">&quot;Year&quot;</font><font color="#000000">,&nbsp;DimCalendarLevel.dclYear);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;an object&nbsp;to&nbsp;parse&nbsp;dates&nbsp;in&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DateConv&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DateConverter.Create();<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;date&nbsp;format<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;DateConv.CalendarDateFormat&nbsp;:=&nbsp;</font><font color="#800000">&quot;$YEAR$&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;DateConv.ConvertShortYear&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Set&nbsp;created&nbsp;object&nbsp;to&nbsp;binding&nbsp;of calendar&nbsp;dimension<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Calend.Converter&nbsp;:=&nbsp;DateConv;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Add&nbsp;a binding&nbsp;for&nbsp;data&nbsp;source&nbsp;values<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;loader.FactBindings.Add(</font><font color="#800000">&quot;Value&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;an object&nbsp;to&nbsp;work&nbsp;with&nbsp;data&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;creator&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtObjectCreator.Create();<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a text&nbsp;data&nbsp;source&nbsp;from&nbsp;file<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;prov&nbsp;:=&nbsp;creator.CreateDtObjectFromFile(</font><font color="#800000">&quot;C:\result_exp.txt&quot;</font><font color="#000000">)&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDtTextProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Specify&nbsp;field&nbsp;delimiter&nbsp;that is used&nbsp;in&nbsp;source<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;prov.DelimitedColumnDelimiter&nbsp;:=&nbsp;</font><font color="#800000">&quot;;&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Load&nbsp;data&nbsp;and&nbsp;process&nbsp;a loading result<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Result&nbsp;:=&nbsp;loader.LoadWithResult(prov,&nbsp;</font><font color="#008080">Null</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;object&nbsp;to&nbsp;which&nbsp;data&nbsp;was&nbsp;loaded<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;:=&nbsp;Result.Object;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Display&nbsp;information&nbsp;about object&nbsp;in&nbsp;console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Name&nbsp;and&nbsp;identifier&nbsp;of created&nbsp;time&nbsp;series&nbsp;database:&nbsp;&quot;</font><font color="#000000">&nbsp;+<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.Name&nbsp;+&nbsp;</font><font color="#800000">&quot;(&quot;</font><font color="#000000">&nbsp;+&nbsp;Object.Id&nbsp;+&nbsp;</font><font color="#800000">&quot;)&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;empty&nbsp;records&nbsp;and&nbsp;display&nbsp;them&nbsp;to&nbsp;console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;:=&nbsp;Result.NullStrings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">If</font><font color="#000000">&nbsp;List.Count&nbsp;&lt;&gt;&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">Then</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Empty&nbsp;records:&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;</font><font color="#008080">Each</font><font color="#000000">&nbsp;Item&nbsp;</font><font color="#008080">In</font><font color="#000000">&nbsp;List&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Arr&nbsp;:=&nbsp;Item&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IArrayList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;Arr.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;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.Write(Arr.Item[i]);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.Write(</font><font color="#800000">&quot;;&nbsp;&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;&quot;</font><font color="#000000">);<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">End</font><font color="#000000">&nbsp;</font><font color="#008080">If</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Get&nbsp;duplicated&nbsp;records&nbsp;and&nbsp;display&nbsp;them&nbsp;to&nbsp;console&nbsp;window<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;:=&nbsp;Result.DuplicatedStrings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">If</font><font color="#000000">&nbsp;List.Count&nbsp;&lt;&gt;&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">Then</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;Duplicated&nbsp;records:&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;</font><font color="#008080">Each</font><font color="#000000">&nbsp;Item&nbsp;</font><font color="#008080">In</font><font color="#000000">&nbsp;List&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Arr&nbsp;:=&nbsp;Item&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IArrayList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;Arr.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;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.Write(Arr.Item[i]);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.Write(</font><font color="#800000">&quot;;&nbsp;&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Diagnostics.Debug.WriteLine(</font><font color="#800000">&quot;&quot;</font><font color="#000000">);<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">End</font><font color="#000000">&nbsp;</font><font color="#008080">If</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:

ICubeLoaderFromSource