The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 VLOOKUP/HLOOKUP (excel) or JOIN LEFT (sql) analog

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
fut Posted - 09/15/2011 : 03:37:00 AM
How to create the third table using comparison of the same key field in two worksheets or workbooks? The first and second tables have the same key field. Result (3'rd) table should include key and date from the first and second table.

This is like Excel VLOOKUP/HLOOKUP function or SQL JOIN LEFT (union) query.

Origin Ver. and Service Release (Select Help-->About Origin): 8.5.1
Operating System: Win7
3   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 04/11/2016 : 5:25:39 PM
Visitors to this thread:

Now Origin supports wjoinbycol x-function command to perform the Join operation from:
http://www.originlab.com/doc/X-Function/ref/wjoinbycol

For the above example, you can run the following command with the "unmatch" option:

wjoinbycol irng:=([Book1]Sheet1,[Book2]Sheet1) condition:="[Book1]Sheet1!A=[Book2]Sheet1!A" unmatch:=1 ow:=[<new>]<new>;

--Hideo Fujii
OriginLab
Hideo Fujii Posted - 09/21/2011 : 1:47:11 PM
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
fut Posted - 09/21/2011 : 11:25:40 AM
Ok. Let me clarify

I have two workbooks: book1 and book2. Book1 includes 118'000 lines, Book2 - 65'000 lines. These books have the same keys (Key column) and different data (Data1, Data2 in Book1 and Data10 in Book2).

I want to compare this books using the same keys and get third book which contain columns from Book1 and Book2. Something like this.


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000