Hello All,
I am having troubles solving this issue:
I am having troubles solving this issue:
- I have a dataset1 that has the variable hhid(no duplicates) that is a household id and a bunch of other variables
- I have another dataset2 where hhid can have duplicates but also have a variable pid that uniquely defines members of the household (pid does not exist in dataset1)
- When hhid is duplicated in dataset2, I make a copy of the existing line in dataset1 for each unique pid that exists for that hhid on dataset2, insert the same pids from dataset2 into those lines then merge on pid.
- When hhid is not duplicated in dataset2, just merge on hhid
Comment