| T O P I C    R E V I E W | 
               
              
                | Thymes | 
                Posted - 10/19/2012 : 02:55:06 AM  Hello everyone,
  I hope someone is able to help me.
  I have 6 columns displaying force data. Now, what I would like to do is find the maximum value within each column and delete all following data points. But I want to keep the data before the maximum is reached.  Any help would be great!
  Thymes
 
  Origin Ver. and Service Release: OriginPro 8.5.0 G SR1 Operating System: Win 7 | 
               
              
                | 2   L A T E S T    R E P L I E S    (Newest First) | 
               
              
                | Thymes | 
                Posted - 10/22/2012 : 03:10:54 AM  Thank you!
  Your script works perfect   This is really a big help!
  More thanks and greetings from Germany Thymes | 
               
              
                | greg | 
                Posted - 10/19/2012 : 11:43:58 AM  The following script takes into account that there may be repeat maximums and uses the last maximum:
  loop(ii,1,wks.ncols) { 	range ra = $(ii); 	dataset ds; 	stats ra; 	vfind ix:=ra value:=stats.max ox:=ds;  	ra.SetSize(ds[ds.GetSize()]); } doc -uw;
  If you only want the first, then use this: loop(ii,1,wks.ncols) { 	range ra = $(ii); 	dataset ds; 	stats ra; 	vfind ix:=ra value:=stats.max ox:=ds;  	ra.SetSize(ds[1]); } doc -uw;
  In the GUI, this amounts to using statistics on columns to find the maximum value, then using Edit : Find to locate the maximum and selecting and deleting all following rows. | 
               
             
           | 
         
       
       
     |