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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 problem with data extraction
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

lastlastlast

UK
Posts

Posted - 06/10/2008 :  05:13:01 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0
Operating System: Win XP

I want to extract some data with a certain series of row indexs. I have put the required index number in a column, column B. I tried to extract the data with Analysis->Extract worsheet data, and write some equations, but fail.

Related euqations such as "if col(C)[i]==col(B)", "col(C)==col(B)" dont work,
where column C is set to be the same as the index in the data, column B is the
required index to be extracted.

Can anyone give me some hints on how to solve this problem?

Thanks.

greg

USA
1380 Posts

Posted - 06/10/2008 :  3:00:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is no notation that will make an IF statement find the values you want. You would need a script of some kind to mark the necessary rows. Here is one example:

get col(1) -e end1;
get col(2) -e end2;
wo -a 2;
set wcol(wks.ncols-1) -e end1;
set wcol(wks.ncols) -e end1;
wcol(wks.ncols-1) = 0;
wcol(wks.ncols) = 0;
loop(ii,1,end) {
val=col(2)[ii];
wcol(wks.ncols-1)=col(1)==val?1:0;
wcol(wks.ncols)+=wcol(wks.ncols-1);
}

which looks for all instances of column 2 values in column 1 and marks a new column with 1. You could then use the new column in a worksheet extraction.

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000