Page 1 of 1

Is it possible to use 2 different data sources?

Posted: Wed Dec 20, 2017 3:04 pm
by cosi
Hi,

I am using one data source #1 that is link to a server and using SQL query to do extraction and data filtering, joining of tables etc. I have another data source #2 in Excel format which I need to 'join' them both. Is it possible to do that after I have import the Excel file into Spss?

Thanks! :D

Re: Is it possible to use 2 different data sources?

Posted: Sat Feb 10, 2018 10:26 pm
by a5000b
Assuming there's a common link between the two files to join on- yes.

The match files command would work in that scenario. Once both data sources have been sorted on the match variable, save each as a .sav file, then you can run a command similar to what is below. The crosstabs afterwards would show you which rows found matches in the two files.

match files
/file = "filepath for first file"
/in = in_file1
/file = "filepath for second file"
/in = in_file2
/by = matching_variable_name.
cache.
execute.

crosstabs tables = in_file1 by in_file2.


If instead you're looking at a situation where one of the files functions as a lookup for the other, then you would want to switch the /file command for that file to a /table command instead.