How run a SPSS Modeler stream from Tm1 process

Post Reply
Palczan
Posts: 26
Joined: Tue Apr 14, 2020 8:57 am
OLAP Product: TM1 Cognos
Version: 11.3.0.27
Excel Version: Office 365 MSO 64bit

How run a SPSS Modeler stream from Tm1 process

Post by Palczan »

Hello,
i have a problem with connection between TM1 and SPSS. I created a stream in SPSS Modeler and inside i import a TM1 Data, do a predict analysis and finally i export a data to TM1.
When i would like to run this stream from TM1 process. I can't do it. Do you have a ideas about it?
Emixam
Posts: 139
Joined: Tue May 21, 2019 3:33 pm
OLAP Product: TM1
Version: PA 2.0.x
Excel Version: 2016
Location: The Internet

Re: How run a SPSS Modeler stream from Tm1 process

Post by Emixam »

Hi,

First I suggest you to take a look at this documentation.

Second, if you are looking for example of TI to send data in SPSS or vice-versa, you should look at the famous TM1 sample called 24retail. Usually you'll find that sample in: TM1_installation_location\samples\tm1\24Retail

Finally, if you want to run the SPSS model through TM1 (actually it will be a .BAT command), you should take a look at the TI called run spss prediction in that same directory.

Enjoy !
User avatar
Elessar
Community Contributor
Posts: 340
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: How run a SPSS Modeler stream from Tm1 process

Post by Elessar »

Hi,

As an addition: refer to this documentation to create the bat/cmd file: https://www.ibm.com/support/knowledgece ... rence.html
Last edited by Elessar on Sat Jan 06, 2024 2:13 pm, edited 1 time in total.
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Palczan
Posts: 26
Joined: Tue Apr 14, 2020 8:57 am
OLAP Product: TM1 Cognos
Version: 11.3.0.27
Excel Version: Office 365 MSO 64bit

Re: How run a SPSS Modeler stream from Tm1 process

Post by Palczan »

Thanks for your answer.
I read this documentation and saw complete models but I have problem with batch file. When I want run Batch I have a problem with login to Tm1 Import. I write a parameters into file but i don't know why doesn't worth.Bellow I add this statement:

clemb -execute -stream "E:\SPSS TM1 Demo.str" -P:tm1import.pm_host="http://152.14.44.2:5895/pmhub/pm"
-P:tm1import.tm1_connection={\"POC Server\",\"\",\"login\",\"password\"}
-P:tm1import.selected_view={\"Sales History\",\"_Import to SPSS Modeler\"}

Anybody, can help me?

Best regards
Palczan
User avatar
Elessar
Community Contributor
Posts: 340
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: How run a SPSS Modeler stream from Tm1 process

Post by Elessar »

  1. Which IntegratedSecurityMode do you use? If 5, try with 1
  2. Do you have SPSS Modeler Server installed? You can store credentials there
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Palczan
Posts: 26
Joined: Tue Apr 14, 2020 8:57 am
OLAP Product: TM1 Cognos
Version: 11.3.0.27
Excel Version: Office 365 MSO 64bit

Re: How run a SPSS Modeler stream from Tm1 process

Post by Palczan »

1. I set a IntegratedSecurityMode = 1
2. i have only SPSS Modeler 18.2.1
User avatar
Elessar
Community Contributor
Posts: 340
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: How run a SPSS Modeler stream from Tm1 process

Post by Elessar »

I really didn't work closely with clemb arguments :)

Try to add this script in the Stream (Tools, Stream Properties, Execution) and execute just "clemb -execute -stream "E:\SPSS TM1 Demo.str""

Code: Select all

stream = modeler.script.stream();
node = stream.findByID("Id_of_your_TM1_Source_Node");
node.setPropertyValue("pm_host", "http://local:9510/pmhub/pm");
node.setPropertyValue("tm1_connection",
["Planning Sample","","admin","apple"]);
node.setPropertyValue("selected_view", ["plan_BudgetPlanLineItem", "SPSS_EXPORT"]);
stream.execute();
BTW, does you TM1(PA) version still have PMhub?
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Palczan
Posts: 26
Joined: Tue Apr 14, 2020 8:57 am
OLAP Product: TM1 Cognos
Version: 11.3.0.27
Excel Version: Office 365 MSO 64bit

Re: How run a SPSS Modeler stream from Tm1 process

Post by Palczan »

Thank for your answer.
1) I checked your solution and i have one error. SPSS shows me a statement: "NoneType" has no attribute 'setPropertyValue'.

2)My version TM1 Still have PMhub.

Best regards
Palczan
User avatar
Elessar
Community Contributor
Posts: 340
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: How run a SPSS Modeler stream from Tm1 process

Post by Elessar »

I've found error in your command line: "tm1import" works only with SPSS versions <=17 (and my script also ;) )

You need to use tm1odataimport: https://www.ibm.com/support/knowledgece ... slots.html
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Palczan
Posts: 26
Joined: Tue Apr 14, 2020 8:57 am
OLAP Product: TM1 Cognos
Version: 11.3.0.27
Excel Version: Office 365 MSO 64bit

Re: How run a SPSS Modeler stream from Tm1 process

Post by Palczan »

Okey,
Thanks for your answer. Now i create a execution but i have a problem with parameter. When I want to add input_credential I must entry a domain, user name and password. Do you know where can I check a domain parameter

Best regards
Kamil
User avatar
Elessar
Community Contributor
Posts: 340
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: How run a SPSS Modeler stream from Tm1 process

Post by Elessar »

Domain is for CAM security. You do not need it with ISM=1
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Palczan
Posts: 26
Joined: Tue Apr 14, 2020 8:57 am
OLAP Product: TM1 Cognos
Version: 11.3.0.27
Excel Version: Office 365 MSO 64bit

Re: How run a SPSS Modeler stream from Tm1 process

Post by Palczan »

Hello everyone,

I find a solution about it.
You must add this script in the Stream (Tools, Stream Properties, Execution) and run the stream on the end.

Code: Select all

node = stream.findByID("Id_of_your_node")
node.setPropertyValue("admin_host", "admin_host_with_port");
node.setPropertyValue("server_name", "Server_test"); 
node.setPropertyValue("credential_type","inputcredential");
node.setPropertyValue("input_credential",["","login","password"]);
node.setPropertyValue("selected_view",["Sales_History","_Import to SPSS Modeler"]);
node.setPropertyValue("selected_columns",["Dim_1"]);
node.setPropertyValue("selected_rows",["Dim_2","Dim_3","Dim_4","Dim_5","Dim_6","Dim_7","Dim_8"]);
Palczan
Posts: 26
Joined: Tue Apr 14, 2020 8:57 am
OLAP Product: TM1 Cognos
Version: 11.3.0.27
Excel Version: Office 365 MSO 64bit

Re: How run a SPSS Modeler stream from Tm1 process

Post by Palczan »

Hello everyone,

On the last answer i wrote that i had a solutions.I tried to run a batch file from tm1 process .Unfortunelly, this process doesn't worked. luckly a few days ago i find the solutions. Firstly, i must write a script for tm1 import and tm1 export in SPSS. This code find on this page
https://www.ibm.com/support/knowledgec ... lots.html

Code: Select all

node = stream.findByID("Id_of_your_node")
node.setPropertyValue("admin_host", "admin_host_with_port");
node.setPropertyValue("server_name", "Server_test"); 
node.setPropertyValue("credential_type","inputcredential");
node.setPropertyValue("input_credential",["","login","password"]);
node.setPropertyValue("selected_view",["Sales_History","_Import to SPSS Modeler"]);
node.setPropertyValue("selected_columns",["Dim_1"]);
node.setPropertyValue("selected_rows",["Dim_2","Dim_3","Dim_4","Dim_5","Dim_6","Dim_7","Dim_8"]);
The next stage is simple. you must add to the tm1 process a simple script. This script is below

Code: Select all

sCommand='"C:\Program Files\ibm\SPSS\Modeler\18.2.1\bin\clemb.exe" -stream "C:\Stream1 trying.str" -execute -log "C:\Stream1 trying.log"';
ExecuteCommand(sCommand,1);
And this is all. If you will have a problem, please ask me on private message
Post Reply