Search code examples
spssspss-modeler

How to combine/merge rows in SPSS Modeler?


Please advice how to transform the original dataset to the expected output as shown below on SPSS Modeler?

It is expected to merge the values of all rows shared the same ID No.

Original dataset

Expected output


Solution

  • If SPSS syntax is availabel to you, the following aggregation command should do the trick:

    aggregate outfile=* /break=ID /date_1 from_1 to_1 date_2 from_2 to_2=
                               max(date_1 from_1 to_1 date_2 from_2 to_2)