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
 Conditional operator for Set column values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Jon-in-Germany

6 Posts

Posted - 08/23/2013 :  05:35:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. OriginPro 9.0. and Service Release (Select Help-->About Origin):
Operating System: W7

Hello,

I want to use "Set column values" to output values in a column that are conditional to values in two other columns.

In Col(A) I have integer values ranging from 1-10 and in Col(B) the same (but not identically ordered).
In Col(C) I have a range of values (let's say, random numbers).

Now, I would like to output the values of Col(C) to a new column, Col(D), according to specific values in Col(A) and Col(B).

For example, if Col(A)=2 and Col(B)=5, then Col(D)=Col(C).

If these conditions are not met, individual rows of Col(D) should be left blank.

I know that it is a simple operation, but I am not familiar with the conditional operators in Origin and can't get anything I try to work.

Any suggestions would be very much appreciated.

Thanks
Jon

Edited by - Jon-in-Germany on 08/23/2013 05:39:36 AM

Hideo Fujii

USA
1582 Posts

Posted - 08/23/2013 :  07:42:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jon,

The conditional operator has the following syntax:
  <Condition>?<True>:<False>
thus, you can write the formula like this:
  (Col(A)==2 && Col(B)==5)?Col(C):1/0
Worked?

--Hideo Fujii
OriginLab
Go to Top of Page

Jon-in-Germany

6 Posts

Posted - 08/23/2013 :  07:59:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hideo, you are a lifesaver, thank-you. It works just how I wanted it to.

Thanks again.
Jon
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