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
 set col value to string var w/ conditional operato

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
eathiele Posted - 09/07/2012 : 2:01:09 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.1 SR2
Operating System: Win7

I am trying to create a basic analysis template that multiple non-experienced users can apply to process data and produce a uniform output format. I have no problem creating a summary sheet for analyzed data, but I am also trying to highlight problematic samples -- i.e. "extract" sample IDs for samples that don't meet quality control minima (excess variation, etc.). I say "extract" because I'm not necessarily interested in creating a separate worksheet -- ideally the output will be limited to one sheet that can be exported as a single csv or dat file. Instead, I have been trying to Set Column Values on a new column to the sample ID for only the samples that do not meet quality criteria. For example, if %CV>10, fill corresponding cell in new column with sample ID.

I am not experienced at scripting/coding at all, but have tried using simple conditional operator statements and the treplace function. These work fine as long as the replacement expression (e.g. sample ID) is numerical, but I cannot get it to copy over sample IDs stored as string variables. I have tried substitution notation to try and "pass in" the variable, but get an error message that says math cannot be performed on text (though technically, I'm not trying to do math on the text.....).

As I said, I'm not experienced in scripting and this is becoming highly frustrating -- particularly because I could accomplish this immediately with a simple if/then statement in Excel. Is there something equally simple here that I'm missing? I realize I could return a 0/1 value or alternative numerical value, but that then requires users to trace back across the rows to identify problematic samples. For the sake of reducing human read errors and the need for additional post-analysis data manipulation, this is obviously not ideal.

I would really appreciate any suggestions!!
1   L A T E S T    R E P L I E S    (Newest First)
Kathy_Wang Posted - 09/14/2012 : 01:05:21 AM
Hi,

If I understand correctly, your question is mainly concerned about how to pass a string variable into a specific cell, and the syntax should be as following:


%A="Sample1";//Use substitution notation to store the sample ID
col(1)[1]$=%A;//Use the Sample ID string to fill in the first cell in column 1.


I assume your error message pops up because when you pass a string variable to a cell you didn't use the symbol "$" to indicate passing it as a text, if this doesn't help in your case, you may post the script which leads to the error message here and we could try to see if there is a solution.

Kathy
Originlab

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