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
 Simple Data Shifting

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
jewfrojon@ucf Posted - 01/14/2013 : 4:59:47 PM
I feel dumb that I can't figure this out:

I want to "Set Column Values" with a script like "Col(A) - X" where X is the value in Col(A) that coincides with the minimum value for Col(B).
Is there an easy way to do this?

-Jon
1   L A T E S T    R E P L I E S    (Newest First)
JessieWoo Posted - 01/15/2013 : 05:08:56 AM
Hi Jon,

I’m not exactly sure what do you really mean by “X is the value in Col(A) that coincides with the minimum value for Col(B)”, do you mean that you first get the minimum value of Col(B) and its row index, then use the value in Col(A) with the same row index as X? If so, you could define the X with Labtalk script in the Before Formula Script dialog, the detailed procedure is as below:

1. In the Set Column Values dialog, type the following scripts in the Before Formula Scripts text box (click the downward arrow button next to OK if the Before Formula Scripts text box is not opened).

//scripts start
//define a dataset to contain X's index
dataset ds; 
//find the minimum value in Col(B)
dd=min(col(B));
//row indices of the minimum value(s) in Col(B) will be returned to dataset ds
vfind ix:=col(B) value:=dd ox:=ds;
//Get the X value
X=col(A)[ds[1]];
//scripts end

2. Type "col(A)-X" in the set values text box.
3. Click OK.

Best Regard,
Jessie
Originlab Corp.

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