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
 how to set column value for a set length
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ywh

USA
4 Posts

Posted - 11/07/2014 :  5:42:16 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9.0
Operating System: Windows 7

I'm new to Origin and would like some help on this task.

I have a column of numbers Col(A), mostly 1s, a few 10s and 0s. The 10s and 0s are flags. I want to set numbers in Col(B) based on these flags. If Col(A)[1] is 10, then I want to set Col(B)[1] through Col(B)[250] to be 1. If Col(A)[1000] is 0, then I want to set Col(B)[1000] through Col(B)[1500] to 2. The rest will be 0.

How do I achieve setting the new column value for a certain length either using "Set Column Value" or other scripts?

Thanks a lot!

greg

USA
1378 Posts

Posted - 11/10/2014 :  11:27:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You have asked for two non-exclusive conditions each with separate ranges so Set Column Values would need to be used three times.
The first would fill the full range of column B with zero. (From = 1, To = whatever needed)
Next, for rows 1 to 250 you could use the expression
col(A)[1]==10?1:0
Finally, for rows 1000 to 1500 you could use the expression
col(A)[1000]==0?2:0

Of course LabTalk could be used for a programmed solution.
Go to Top of Page

ywh

USA
4 Posts

Posted - 11/12/2014 :  3:00:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Greg:
Thanks a lot! I realized that "Set Column Values" is probably insufficient to achieve the goal, so I'm switching to LabTalk now.
Thanks!
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