I have two datasets, named data1 and data2. data1 look like:
id1 id2 exc1 exc2 exc3 exc4
"aa2" "12ac" 45 54 53 65
"bb" "23" 23 33 23 12
data2 looks like:
kid1 id2 sf1 sf2 sf3 sf4 exc1 exc2
"aa2" "ads2" 55 6 55 66 45 54
The kid1 column and id1 column have the same entries, just the number of rows in both dataset is different. There are some rows missing in data1 which I have to pick from data2. To do this I have to combine id1 and id2 in data1 and kid1 and id2 in data2 and create a new column called link. In excel I did this like "aa2 | 12ac" and similarly for data2. Further I have to search which entries of link are present in data2 but not in data1 and I have to add them in data1.
The condition for adding new rows in data1 from data2 is that: if columns name are same in data1 and data2, then use the data from data2 otherwise the column name which are not present in data2 but are present in data1, copy the data from row where kid1 = id1.
I have done the entire thing in excel and wanted to replicate the entire thing in kdb to make the process faster. It'd be great if someone can help me on this. Any leads on this is appreciated. Thanks