Patricia
Patricia

Reputation: 41

How to build "if statement" in SPSS Modeler?

could you please advise how to build "if statement" in SPSS Modeler if we have two data sources?

One data source (1) is a table (an output node generated by SPSS Modeler) where all the IDs are listed with which we need to work further.

Another data source (2) is an Excel file where all the IDs are listed whereas this list includes some IDs from (1) but also some additional ones - to all these IDs are assigned values that are needed to be added to the data source (1) not necessarily to the table.

So if the ID from (1) is in (2) we would like to assign a value from (2) to the ID in (1) and have it stored in some table or even better in a file.

Thank you very much for your help / advice.

Patricia

Upvotes: 1

Views: 1829

Answers (2)

Érica Wong
Érica Wong

Reputation: 119

You will have to use the Merge Node to combine the 2 datasets but you don't have to give the same name for the keys IDs. You can use the option condition in the Merge Node without the necessity of having the same name and even the same type of variable.

Syntax example for the merge Node - option condition: 'ID' = 'id'

Upvotes: 1

Rebecca Young
Rebecca Young

Reputation: 19

Based on your problem it sounds like you want to merge these datasets. This can be easily done in Modeler via the Merge Node, just make sure the variables have the same name or Modeler won't recognize it as a key. You can see an example here

You can also create a flag variable using the Derive node, see example here

Upvotes: 1

Related Questions