Data set 1
Barcode | SEQ | ITEM NO | REC NO | FGROUP | GRAMAMOUNT | RECORDID | AMOUNT | UNIT | |
A11 | 1 | 1 | 0 | 01.01.02 | 30 | QP112 | 30 | g | |
A11 | 2 | 1 | 0 | 04.02.01 | 23 | RE3421 | 15 | ml | |
A11 | 1 | 2 | 1 | 99.99.99 | 0 | 50 | % | ||
P12 | 1 | 1 | 1 | 12.04.11 | 12 | A120 | 12 | g |
Barcode | SEQ | REC NO | FGROUP | GRAMAMOUNT | RECORDID | AMOUNT | UNIT | ||
A11 | 1 | 1 | 20.01.02 | 1.2 | CS | 1.2 | g | ||
A11 | 1 | 1 | 12.02.01 | 63 | PW145 | 60 | ml | ||
A11 | 1 | 1 | 03.03.01 | 12 | K102 | 10 | ml | ||
I would need to merge data set 2 into data set 1 by matching the barcode, seq and rec no.
In this instance the item in the third row matches all the items in data 2 and that is what I need, for 1 row in dataset 1 to be populated by all three rows in the merged data set.
So the merged dataset should look like this
Barcode | SEQ | ITEM NO |
REC NO | FGROUP | GRAMAMOUNT | RECORDID | AMOUNT | UNIT | |
A11 | 1 | 1 | 0 | 01.01.02 | 30 | QP112 | 30 | g | |
A11 | 2 | 1 | 0 | 04.02.01 | 23 | RE3421 | 12 | ml | |
A11 | 1 | 2 | 1 | 20.01.02 | 0.6 | CS | 0.6 | g | |
A11 | 1 | 2 | 1 | 12.02.01 | 31.5 | PW145 | 30 | ml | |
A11 | 1 | 2 | 1 | 03.03.01 | 6 | K102 | 5 | ml | |
P12 | 1 | 1 | 1 | 12.04.11 | 12 | A120 | 12 | g | |
And if the amount and unit in data set 1 is for example 50% then what is being populated in merged dataset will show 50% of the value in data set 2.
Will I be better off to append than to merge?
Thank you very much.
Nan Xin
0 Response to Merging two datasets
Post a Comment