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 find the biggest value in a column?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Selinger78

Germany
Posts

Posted - 08/25/2004 :  08:36:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello!
I am using Origin 6.0 and as an origin beginner I am not very familiar with all the functions. I have a relativly simple task, I need to fill an empty column with the highest value of an existing column. So I open the dialoge box "set column values" but then I don't find a function to display the maximum value of a certain column!
Can anybody helb me?
Best regards,
Selinger 78

Mike Buess

USA
3037 Posts

Posted - 08/25/2004 :  08:58:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Probably easiest to use LabTalk's sum() function. Say you want to find the largest value in col B and set all rows in a new col named Max to that value...

wo -v Max; // create col Max if it doesn't already exist
col(Max)=col(B); // give it some initial values
sum(col(B)); // find sum.max, sum.min, sum.total, etc
col(Max)=sum.max; // set all rows in col Max to maximum value col B

...You'll need to run those commands from the script window rather than the Set Column Values dialog.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/25/2004 09:02:52 AM
Go to Top of Page

Selinger78

Germany
Posts

Posted - 08/25/2004 :  09:38:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the fast answer!
However, I somehow cannot execute such a script, when I type "run" I get an error message that says "the initial configuration script file is missing or not in the directory".
How do I have to continue in such a case?
Best regards,
selinger78

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 08/25/2004 :  10:16:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
A command or series of commands typed in the script window is executed automatically when you press Enter. Copy the four command lines from my previous post to your script window, select (highlight) all four lines and then press Enter.

You can do this partially with the Set Column Values dialog after all. Start by finding the maximum value from the script window...

sum(col(B))<Press Enter>

Now open Set Column Values dialog and enter the expression sum.max for the Col(Max) value.

...There is an easier way to do this if Origin 6.0 has a Normalize command on the context menu for columns. (I don't remember whether or not it does.)

1. Right-click on the column from which you want to obtain the max value and select Normalize (if it exists) on the resulting menu.

2. The default value offered in the Normalize dialog is the max value. Copy (Ctrl+C) that value to clipboard. Then press Cancel to close the dialog.

3. Open the Set Column Values dialog for the column in which you want to put the max value. Paste (Ctrl+V) the value from the clipboard into the expression box.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/25/2004 10:57:29 AM
Go to Top of Page

Selinger78

Germany
Posts

Posted - 08/26/2004 :  05:10:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks!
Now it works!

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