Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
lastlastlast
Posted - 06/10/2008 : 05:13:01 AM 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.
1 L A T E S T R E P L I E S (Newest First)
greg
Posted - 06/10/2008 : 3:00:34 PM 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.