Dynamic Datasource Path

User avatar
jim wood
Site Admin
Posts: 3577
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: TM1 10.2.2
Excel Version: 2007
Location: 1639 Route 10, Suite 107, Parsippany, NJ, USA
Contact:

Re: Dynamic Datasource Path

Post by jim wood » Thu Sep 01, 2016 12:29 pm

I've just gone through this. I can't remember where I was at the time but I do know I'm no hurry to go back. It's ironic that I'm now at a government agency and the security policies are no where near as tight inside the IT department.
Struggling through the quagmire of life to reach the other side of who knows where.
Application Consulting Group (ACG) TM1 Consulting
OS: Windows 10 64-bit. TM1 Version: 10.2.2

Hector2005
Posts: 36
Joined: Wed Jan 31, 2018 2:01 pm
OLAP Product: MOLAP
Version: 10.2
Excel Version: 2013

Re: Dynamic Datasource Path

Post by Hector2005 » Thu Jul 19, 2018 9:05 am

Hello Guys,
I have a problem to assign the file path in runtime.

I have made a ti process and select the type is File then assigned a template Excel file "Just contained a header" I attached it.

after that I opened the prolog tab : and wrote the following.

Code: Select all

DataSourceNameForServer = 'C:\Program Files\ibm\cognos\tm1_64\samples\tm1\Test\Templates\ProductionData.xlsx';
In the Data tab: I wrote the following as you see Just a simple code to check if it's okay or not.

Code: Select all

Version = 'Plan';

IF(Accounts @<> 'Accounts' );

	IF(DimIx('ProductionDim', Accounts) > 0);
	
		CellPutN(Year1/12, 'Production','Jan 2018' , Accounts, Version);
	
	ENDIF;

ENDIF;

If this doing well I will make a cube then put all my paths in it.

But, Unfortunately it doesn't work. Is there anything I missed ???

Thanks in advance,
Best Regrads.
Attachments
Template.JPG
Template.JPG (15.31 KiB) Viewed 61 times
File I want to Load.JPG
File I want to Load.JPG (62.15 KiB) Viewed 65 times

declanr
MVP
Posts: 1587
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Dynamic Datasource Path

Post by declanr » Thu Jul 19, 2018 10:00 am

TIs don’t accept xls or xlsx etc rules as a source, it needs a flat file to read (CSV, CMA, TXT etc.)
I believe performance modeller could accept excel files but I think that just had an additional program that converted it to a CSV first, you can do something similar yourself by having VBS executed in the prolog to convert the xlsx to a CSV and then set the CSV as your data source.

Hector2005
Posts: 36
Joined: Wed Jan 31, 2018 2:01 pm
OLAP Product: MOLAP
Version: 10.2
Excel Version: 2013

Re: Dynamic Datasource Path1

Post by Hector2005 » Fri Jul 20, 2018 2:17 am

declanr wrote:
Thu Jul 19, 2018 10:00 am
TIs don’t accept xls or xlsx etc rules as a source, it needs a flat file to read (CSV, CMA, TXT etc.)
I believe performance modeller could accept excel files but I think that just had an additional program that converted it to a CSV first, you can do something similar yourself by having VBS executed in the prolog to convert the xlsx to a CSV and then set the CSV as your data source.
Appreciated sir, You are right it worked.
Really this is amazing community, Because everyone helps the others. :) :)

Thanks a lot,
Best Regards.

Post Reply