passing variable as parameters to TM1runti

Post Reply
Rtel
Posts: 52
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

passing variable as parameters to TM1runti

Post by Rtel » Wed Dec 04, 2019 9:43 pm

Following code in TI process TESTPROC1 works fine

executecommand ('path/tm1runti.exe -adminhost myadminhost -server myserver -user "Admin" -pwd apple -process TestCalledProc parameter1="aaa" parameter2="bbb" ' , 1 ) ;

I have 2 parameters in TESTPROC1 as P1 and p2

Now if I want to pass a parameter P1 for "aaa" and P2 for "bbb" how can I do that

Thanks

Rtel

Wim Gielis
MVP
Posts: 2278
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

Re: passing variable as parameters to TM1runti

Post by Wim Gielis » Wed Dec 04, 2019 11:39 pm

executecommand( Expand('path/tm1runti.exe -adminhost myadminhost -server myserver -user "Admin" -pwd apple -process TestCalledProc parameter1="%P1%" parameter2="%P2%" ') , 1 ) ;
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 109 TM1 articles and a lot of custom code
Newest blog article: Set up a TM1 model with AutoHotKey as a service or application

Rtel
Posts: 52
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

Re: passing variable as parameters to TM1runti

Post by Rtel » Thu Dec 05, 2019 9:14 pm

P1 = account1
P2 = account2

Calling proc
executecommand ('path/tm1runti.exe -adminhost myadminhost -server myserver -user "Admin" -pwd apple -process TestCalledProc parameter1="%P1%" parameter2="%P2%" ' , 1 ) ;


Called proc

ASCIIOUTPUT('filepath/TestOutput.csv', ' The parameter value is ' | P1 | ' AND ' | P2 );


Expected output in TestOutput.csv

The parameter passed is account1 AND account2

Actual Output I am getting ....

The parameter passed is %P1% AND %P2%

Please let me know what I am missing

Thanks

Rtel

Wim Gielis
MVP
Posts: 2278
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

Re: passing variable as parameters to TM1runti

Post by Wim Gielis » Thu Dec 05, 2019 9:18 pm

Rtel wrote:
Thu Dec 05, 2019 9:14 pm
Please let me know what I am missing
The Expand function.
Did you double check and triple check with my suggested code ?
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 109 TM1 articles and a lot of custom code
Newest blog article: Set up a TM1 model with AutoHotKey as a service or application

Rtel
Posts: 52
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

Re: passing variable as parameters to TM1runti

Post by Rtel » Thu Dec 05, 2019 10:01 pm

Hi Wim, I missed the expand function in the code

It's working now !

Thank you very much

Rtel

Post Reply