Multiple Source files

Post Reply
daitaylor
Posts: 10
Joined: Thu Jan 27, 2011 3:27 pm
OLAP Product: TM1
Version: 8.4.2
Excel Version: 2003

Multiple Source files

Post by daitaylor »

hi,

I'm running 8.4.2 and Excel 2003

i have to load the data from a series of txt files where i will know the opening batch number and the closing batch number but the numbers will not be complete - some relate to a different company that i don't want to load - they won't be in the folder so won't get in the way

i have set up my process in TI to load the first file but now need to have them all load

I think that i need a WHILE loop to load each file in turn. There is a slight complication that the batch file is split in two, some common info in both taht allows me to create attributes in a dimension that allows the load of the data from the second file. I could load all the attributes from the on file type first in process 1 and then all the data files in process2

I'm not clear how i get the counter in the WHILE statement to not fall over when a batch is missing

any suggestions gratefully received

D
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Multiple Source files

Post by tomok »

You can't process multiple data sources in a single TI process. Only one source per TI because there is no TI function for "opening" a file. That function is built into TI. A WHILE loop wouldn't do you any good because there is no way to open the next source. You CAN link TI's together by calling them from each other but I'm not a big fan of that. Just link them together with a chore if you have to.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Kyro
Community Contributor
Posts: 126
Joined: Tue Nov 03, 2009 7:46 pm
OLAP Product: MODLR - The CPM Cloud
Version: Always the latest.
Excel Version: 365
Location: Sydney, Australia
Contact:

Re: Multiple Source files

Post by Kyro »

Have a "master" TI Process with your WHILE loop. Cycle from start batch number to end (taking into account anomalies where possible) and for each file use the "EXECUTEPROCESS" function to launch your "slave" process and add the filename as a parameter to that "slave" process. Use the Global Variables in your "Slave" TI to set the datasource to the given file. Should work like a charm if your data files are systematic enough.
Andy Key
MVP
Posts: 352
Joined: Wed May 14, 2008 1:37 pm
OLAP Product: TM1
Version: 2.5 to PA
Excel Version: Lots
Location: Sydney
Contact:

Re: Multiple Source files

Post by Andy Key »

If you don't know the precise names of your files, but you want to load all files in a directory you can use WildcardFileSearch as the basis of your While loop.
Andy Key
daitaylor
Posts: 10
Joined: Thu Jan 27, 2011 3:27 pm
OLAP Product: TM1
Version: 8.4.2
Excel Version: 2003

Re: Multiple Source files

Post by daitaylor »

thanks for the advice - I'll test it out tomorrow when I'm back at that client
Post Reply