Variable names for a TI Data Source name

Post Reply
par3
Posts: 82
Joined: Tue Sep 09, 2008 7:05 am

Variable names for a TI Data Source name

Post by par3 »

Hey Guys!

What I want to know is if it is possible to use a variable to define the path/name of your "Data Source Name" in your TI opening tab. The problem occurs when a client runs to TI from his PC then the path to the data file will start with "\\Name of server etc." but sometimes they want to use a remote desktop connection and run the TI process directly from the server. That means the path to the data file will now have to start with "C:\path to file".

Is there any way you can make use of a variable that asks if you are running the process from your own pc or from the server and then define the path to the datafile within the TI process.

Thanks a lot!
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Variable names for a TI Data Source name

Post by Alan Kirk »

par3 wrote:Is there any way you can make use of a variable that asks if you are running the process from your own pc or from the server and then define the path to the datafile within the TI process.
Assuming that you're running it manually rather than scheduling it you can always add a Parameter to the process in question via the Advanced tab, parameter sub-tab. However you seem to be under a misapprehension:
when a client runs to TI from his PC then the path to the data file will start with "\\Name of server etc." but sometimes they want to use a remote desktop connection and run the TI process directly from the server. That means the path to the data file will now have to start with "C:\path to file".
The "\\Name of server etc" is what's called a UNC reference. It's just as valid for a server as it is for a local user, as long as the login that the TM1 server session is running on has permission to access to that shared location.

However if you really do want to use different sources, look in on-line help for the TI Process variables named DatasourceNameForServer and DatasourceNameForClient. You can use these in the Prolog to change the data source if you need to.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
John Hobson
Site Admin
Posts: 330
Joined: Sun May 11, 2008 4:58 pm
OLAP Product: Any
Version: 1.0
Excel Version: 2020
Location: Lytham UK
Contact:

Re: Variable names for a TI Data Source name

Post by John Hobson »

The best I have managed here is to take Alan's approach but to add another parameter into my parameters cube and refer to that in the prolog (which save manually typing the paths every time you want to change it)

#In the parameters cube enter:
#1 for network address DevServer (\\...).
#2 for network address ProdServer (\\...)
# or 3 for (C:\,,,,)

UseNetworkAddress = numbr(cellgets('parameters','Use Network Address','SSelection')) ;

If (UseNetworkAddress = 1);
ClientDataDirectory = '\\DevServer\Data_Files\';
ServerDataDirectory = '\\DevServer\Data_Files\';
Endif;

#If (UseNetworkAddress = 2);
#ClientDataDirectory = '\\ProdServer\Data_Files\';
#ServerDataDirectory = '\\ProdServer\Data_Files\';
#Endif;

If (UseNetworkAddress = 3);
ClientDataDirectory = 'c:\planning\data files\';
ServerDataDirectory = 'c:\planning\data files\';
Endif;

HTH

John
John Hobson
The Planning Factory
par3
Posts: 82
Joined: Tue Sep 09, 2008 7:05 am

Re: Variable names for a TI Data Source name

Post by par3 »

Thanks a lot people! I think the simplest way is just to use the UNC(or whatever its called) path. I have tried this before but got some problems but I probably just wasn't using it right. The other ideas are very cool I am most certainly going to consider them if I get some trouble!
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Variable names for a TI Data Source name

Post by Alan Kirk »

par3 wrote:Thanks a lot people! I think the simplest way is just to use the UNC(or whatever its called) path. I have tried this before but got some problems but I probably just wasn't using it right.
UNC = Universal Naming Convention; see http://wiki.olapforums.com/index.php?title=UNC .

If you run into problems using a UNC reference on the sever, odds are that the account that the TM1 server is running under doesn't have access to the shared folder.

The easiest way to test this is to open a session of Windows Explorer on the server (under the account that the TM1 service or application is using), and enter the UNC address into the address bar. If you can't access the folder, or can't open the files in that folder, it means that you have a permissions problem.

The big advantage of using a UNC reference is that the path looks exactly the same to both client and server, so as long as both have the required permissions it doesn't matter which one you're running from.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Steve Rowe
Site Admin
Posts: 2416
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Variable names for a TI Data Source name

Post by Steve Rowe »

It's worth pointing out the that the client side path is only required when you are editting a process which end-users probably should not do.

The TI process is a server side action so at run time the only path that is relevant is the server side path which should only be changing if you are actually moving the location of where the file is saved or the name of the file. If you open a TI from a client and it generates file location errors then this does not matter so long as the server side path is correct. Although the code is available I can't see the benefit of modifying the client side path at run time since it is not used for anything...

I also use the same approach as John, a server properties cube with the various client and server side paths in them. These are then refered to excel workbooks or TI processes as required.

Cheers
Technical Director
www.infocat.co.uk
Post Reply