hi, i need a help in regarding a creating a loop for values in select node using the python script.
in spss modeler i have build a stream for time series model but here i have selected one part and i raned the time series node. i have 20 parts so i do not want to select each and every part separately and then running the model.
for that i am trying to create python scripting it will take one by one part and it should run the time series model and it should export it to the excel file.
this is the python program which i wrote. but i am getting a error as
Error: AEQMJ0100E: Script error (Time Series: Dependent series is all missing in the estimation span.) on line 18 column 1
python scripting: stream = modeler.script.stream() iterationKey_StreamParameter = u"part" iterationKey_NodeValues = [u'22847',u'23131',u'23286',u'23409',u'23422',u'23462',u'23463', u'23464',u'23520',u'23524',u'23526',u'24302',u'24320',u'25320',u'25349', u'27935',u'31622',u'32007',u'32016',u'32626'] iterationKey_NodeID = "idBJTK7GA4KY" # "Excel":excelexport iterationKey_NodeProperty = "full_filename"
for i in range(len(iterationKey_NodeValues)): # initialize iteration key value = iterationKey_NodeValues[i] stream.setParameterValue(u"part",value) node = stream.findByID(iterationKey_NodeID) node.setPropertyValue(iterationKey_NodeProperty,value)
# Now execute the stream for this iteration executionResults =  stream.runAll(executionResults)
print "Execution completed"
Please help me with this error.
This is actually not an error in the script, but in the stream itself. It is merely triggered by the script as it executes the stream.
You have a 'Select' node that selects the records for an individual part number using a parameter, where the value of the parameter is set by the script. In the "Condition" of the node, you have enclosed the parameter name in double-quotes:
'part' = "$P-part"
However, parameter names must be enclosed in single-quotes:
'part' = '$P-part'
As the value will otherwise be interpreted as a literal string value.
If you change this 'Select' node, I think the script will work as intended.