Spss merge and duplicate data

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

simongis
Posts: 2
Joined: Mon Apr 13, 2015 4:14 am

Spss merge and duplicate data

Postby simongis » Mon Apr 13, 2015 4:22 am

Hi,

As you see on my screen shoot. I merge data from a date of reservation and the date for the temperature that day.

But there's some field empty because it will merge the data with my key only once.

How can i duplicate my data when the key " date de la réservation " is the same?

Thanks for the helps
Last edited by simongis on Tue Apr 14, 2015 4:01 am, edited 1 time in total.
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Spss merge and duplicate data

Postby GerineL » Mon Apr 13, 2015 7:44 am

can you provide an indication of what the 2 start files look like, and an example of what the new file should look like?
simongis
Posts: 2
Joined: Mon Apr 13, 2015 4:14 am

Re: Spss merge and duplicate data

Postby simongis » Mon Apr 13, 2015 1:28 pm

For sure ! thanks for the help capture 1 is my starting file and capture 2 is the data i want to merge.

For my result i need temperature data for all my field like the first picture i post.

I hope it's clear enough!

thanks!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Spss merge and duplicate data

Postby GerineL » Mon Apr 13, 2015 1:37 pm

It is not entirely clear to me what variable you want to merge on.

If I understand correctly, the variable you want to merge on in your first file is "datedelareservation", in the second file this is "arrivee". The problem is that there are several variables with the same date for "arrivee". Is that correct?

If this is indeed the case, there is indeed a problem: spss does not know what temperature you want to merge, if there are several "arrivee" dates.
The only way to solve this is to create a file in which each "arrivee" date only occurs once.
You could do that by the "identify duplicate cases" procedure, by which you identify unique "arrivee" cases, and delete the rest.
Another option could be to restructure the file so that there is a separate variable for each temperature matching to an arrivee date, and merge all of these.

in any case, you have to decide first what "arrivee" temperature you want to merge with the first file.



p.s.
I see now that there is also a datedelareservation variable in the second file, but the same goes here; just replace the word arrivee in the text above.

Who is online

Users browsing this forum: No registered users and 2 guests

cron