Is it possible to use 2 different data sources?

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

cosi
Posts: 4
Joined: Fri Dec 15, 2017 3:28 am

Is it possible to use 2 different data sources?

Postby cosi » Wed Dec 20, 2017 3:04 pm

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
a5000b
Posts: 2
Joined: Sat Feb 10, 2018 10:01 pm

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

Postby a5000b » Sat Feb 10, 2018 10:26 pm

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.

Who is online

Users browsing this forum: No registered users and 4 guests

cron