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
 Calculation in Origin 8
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

choklad

Albania
Posts

Posted - 12/12/2007 :  03:57:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 8
Operating System:winxp

I installed Origin 8 a few days ago and have a problem with a simple calculation.
I have serveral worksheets - lets say W1 and W2 - and I want to calculate something in W2, where I need data from worksheet W1.
In the older versions of origin it had worked for example like this:
in column B in W1 I multiplied data from column A in W1 and column C in W2: col(B)=col(A)*W2_col(C)

It seems that this doesent work anymore. The Help-file tells me, that I have to define column C from worksheet W2 as a variable and then I have to calculate with this variable.
This seems to me very complicated (especially because I deal with more than 50 columns in one worksheet and I really don't want to define each one seperately as a variable). Is this the only way to make calculations between different worksheets or is there any easy way out, that I missed?

Regards,
Julia

Mike Buess

USA
3037 Posts

Posted - 12/12/2007 :  08:50:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Julia,

The syntax col(B)=col(A)*W2_col(C) has never worked in Origin. The correct syntax has always been col(B)=col(A)*W2_C and that still works in Origin 8.

Mike Buess
Origin WebRing Member
Go to Top of Page

easwar

USA
1965 Posts

Posted - 12/12/2007 :  6:14:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Julia,

Referring to columns in another book with syntax such as W2_c works as long as you are referring to first created sheet in that book (perhaps all your books have only one sheet?)

But if there are more than one sheet in a given book, then the notation such as W2_c gets complicated as if the column c is in say third created sheet, it needs to be referred to as W2_c@3 in this "old" notation.

That is why we introduced range notation and variables which you came across in help files, that can be used to point to cols in multiple sheets in a flexible way

For example:

// point to col c of sheet 2 of book1
range rc = [book1]sheet2!col(c);
// point to column with long name "system pressure" located in
// sheet with name "my sheet" in book1
range rPressure = [book1]"my sheet"!col(System Pressure);

// Point to col d of currently active sheet
// book and sheet name left out
// this variable then points to col d of whichever sheet is active
range r = !col(d);
r = sqrt(rPressure);
r = sin(rc);



If you find yourself making computations such as this repeatedly maybe it is beneficial to make an OGS script file, or put such computation into the columns themselves using "set values" dialog? With the new set values dialog, you can define variables in lower "before formula" panel and use them in your formual for setting column values

If you need more help you could send your opj to tech and ask for specific help with your scripting

Easwar
OriginLab


Go to Top of Page

choklad

Albania
Posts

Posted - 12/13/2007 :  04:38:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks for your fast replies - I found my mistake.
I used the long name of the worksheet (the one that I can change by right-click and rename) to label the columns in the formulars and not the short name ( the one that I have to change in the properties settings) that is automaticaly set as "Book1", "Book2",.... If I adjust that, I can make my calculations as usual.

Thanks for helping,
Julia
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