looking up and adding values

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 82
Accepted Solution

looking up and adding values

I have two data sets, data set one is a list of 5 games for each observation

Game1Game2Game3Game4Game5
11213798
2781534
6136432
74489956
88896512

Then I have a dataset with info for these games;

GameDateValue
15/1/125
346/2/1219
257/12/124
674/5/126

Basically, I want to add the info from the second dataset to the first, so for game 1, the next two variables would be the data and value (either at the end or next to it, it doesnt matter). So it would go from 5 variables to 15.

I am trying a join, but I cant get that to work with so many different games. I know there should be an easy way I am not thinking of. Any suggestions?


Accepted Solutions
Solution
‎01-16-2013 11:58 AM
Super User
Posts: 17,824

Re: looking up and adding values

Change the structure of your first table to be the following (via proc transpose) and then merge together.

OBS GameNo GameID

1 1 1

1 2 12

1 3 13

1 4 7

1 5 98

View solution in original post


All Replies
Solution
‎01-16-2013 11:58 AM
Super User
Posts: 17,824

Re: looking up and adding values

Change the structure of your first table to be the following (via proc transpose) and then merge together.

OBS GameNo GameID

1 1 1

1 2 12

1 3 13

1 4 7

1 5 98

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 152 views
  • 0 likes
  • 2 in conversation