Page 1 of 1

Loading multiple files data in to a cube using 1 TI Process

Posted: Thu Mar 26, 2015 6:47 am
by gandikota
Hi All,

Please help me out as i need to load multiple files in to a cube using a single TI Process.Assuming all files will be available in one folder.I had checked TM1 refernce doc and find out there is a function WildcardFileSearch to implement this.

Does any one send a snippet for this.Thanks in advance.

Re: Loading multiple files data in to a cube using 1 TI Proc

Posted: Thu Mar 26, 2015 7:53 am
by lotsaram
In the Bedrock library the processes Bedrock.Cube.View.Delete or Bedrock.Dim.Sub.Delete should give you a pretty good example of how to use WildCardFileSearch.

Re: Loading multiple files data in to a cube using 1 TI Proc

Posted: Thu Mar 26, 2015 8:00 am
by declanr

Code: Select all

sFiles = sOutputFolder | '\*.csv';
sStrFile = WildcardFileSearch ( sFiles, '' );
While ( sStrFile @<> '');
	ExecuteProcess ( sSubprocess, 'pFile', sStrFile, 'pStrPath', sOutputFolder | '\' );
	sStrFile = WildcardFileSearch ( sFiles, sStrFile );
End;
Something along the lines of the above; or you can pass it into the sub process via a global variable instead of a parameter.
You can either have a different process to load the data and a master process to call or just build an iterative process that keeps calling itself until it runs out of files.