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
 set col value to string var w/ conditional operato
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

eathiele

USA
3 Posts

Posted - 09/07/2012 :  2:01:09 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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!!

Kathy_Wang

China
159 Posts

Posted - 09/14/2012 :  01:05:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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