Hi fut,
Origin currently doesn't have the JOIN operator like for the relational database.
For now, you need to make a script or OriginC code to do that.
For example, the following script may work for you, though this is quite inefficient and crude, and you may want to improve by adopting a better algorithm:
range Bk1C=[Book1]!col(C);
range Bk2B=[Book2]!col(B);
range Bk3A=[Book3]!col(A);
range Bk3B=[Book3]!col(B);
range Bk3C=[Book3]!col(C);
nr1=Book1!wks.maxRows;
keycol1=1; //col# in Book1
keycol2=1; //col# in Book2
jj=1;
for(ii=1; ii<=nr1; ii++) {
window -a Book1;
v1=wcol(keycol1)[ii];
window -a Book2;
flag=List(v1,wcol(keycol2));
if(flag!=0) {
Bk3A[jj]=v1;
Bk3B[jj]=Bk1C[ii];
Bk3C[jj]$=Bk2B[flag]$;
jj++;
}
}
If your column may have both numbers and text, or if you don't know that exclusively the column is either Text type or Numeric type, you can use the assignment like the following:
if(Bk1C[jj]!=1/0) Bk3B[jj]=Bk1C[ii]; //numeric
else Bk3B[jj]$=Bk1C[ii]$; //characters
instead of Bk3B[jj]=Bk1C[ii];
--Hideo Fujii
OriginLab