1

I have a one problem with SPSS. I want to set the parameter using the python script. The parametr name is pMacroregion and I'm using this parameter in Select Node. In this node I set the column value is equal the parametr value.

In my script, I entry parametr value, but when I add output table, i receive nothing.

import modeler.api

stream = modeler.script.stream()

selectnode = stream.findByID("idTDVEN4CV5I") # select node
tablenode = stream.findByID("idT4WQLYPH6Z") # Table output node
selectnode.setPropertyValue("mode", "Include")
pMacroregion = "CENTRAL EUROPE"
stream.setParameterValue("pMacroregion", pMacroregion)
selectnode.setPropertyValue("condition", "'Macroregion' = '$pMacroregion'")


tablenode.run([])

Can you tell me, what is wrong ?

eli-k
  • 10,898
  • 11
  • 40
  • 44
Palczando
  • 23
  • 4
  • I find the solution. The error was in penultimate line. I change the parametr value from '$pMacroregion' to '$P-pMacroregion'. `selectnode.setPropertyValue("condition", "'Macroregion' = '$P-pMacroregion'")` `tablenode.run([])` – Palczando Dec 02 '21 at 11:54

0 Answers0