Merging Cases

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Merging Cases

SHAWN RAINEY
I have two data sets that have multiple rows per case.  The first data set is family case open and close dates.  Each family may have been open multiple times.  See below:  
CASE ID         CASE NAME              OPEN DATE               CLOSE DATE
1                      XXXX                         4/1/02                          5/1/04                          
1                      XXXX                         6/1/05                          12/15/06                      
1                      XXXX                         1/1/07                          5/1/08              
2                      YYYY                         5/15/02                        7/20/07                        
3                      ZZZZ                           1/1/01                          3/1/04  
3                      ZZZZ                           5/2/05                          7/1/07  
 
The other data set is for the individuals associated with each family.  The active dates are the time frames that the individual was active with the family (i.e., living in the home, receiving services, etc.).  Each person may have been active with the family multiple times during the same case or may have become active after a family case has started and then erroneously left active after the case has closed.  See below:
 
CASE ID         PERSON ID                ACTIVE BEGIN DATE          ACTIVE END DATE
1                      Joe                               4/1/02                                      11/1/06            
1                      Joe                               3/1/07                                      12/15/08
1                      Sue                              6/15/07                                    12/15/08
1                      Jack                             4/1/02                                      5/1/04
1                      Jack                             1/1/07                                      4/15/08            
2                      Doug                            5/15/02                                    7/1/07
2                      Elaine                           6/1/02                                      7/20/07
2                      Fred                             5/15/02                                    6/20/07
3                      Jack                             1/1/01                                      2/28/04
3                      Jack                             6/2/05                                      7/1/07  
                                               
The unique variable for each data set is the Case ID.  Each file has multiple rows per case.  Is there a way that I can do a Merge with multiple rows matching up with every row in the other data set.  Using the first case as an example,  I am hoping to end up with the following:  
 
CASE ID   PERSON ID    ACTIVE BEGIN   ACTIVE END     CASE NAME   OPEN    CLOSE
1                 Joe                   4/1/02                      11/1/06              XXXX              4/1/02     5/1/06  
1                 Joe                   4/1/02                      11/1/06              XXXX              6/1/05     12/15/06
1                 Joe                   4/1/02                      11/1/06              XXXX              1/1/07     5/1/08  
1                 Joe                   3/1/07                      12/15/08            XXXX              4/1/02     5/1/06  
1                 Joe                   3/1/07                      12/15/08            XXXX              6/1/05     12/15/06
1                 Joe                   3/1/07                      12/15/08            XXXX              1/1/07     5/1/08  
 
Now I have every instance of Joe being active with family XXXX matched to every instance of family XXXX being open.  Is this possible?  If not, is another option available?  I am looking to get each persons active and inactive dates paired up the Family open/dates that they fall within.
 
Thanks for the Help.



This e-mail message, including any attachments, is for the sole
use of the intended recipient(s) and may contain private,
confidential and/or privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are
not the intended recipient, employee or agent responsible for
delivering this message, please contact the sender by reply e-
mail and destroy all copies of the original e-mail message.

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD