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 of cell values with column parameter
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

maxm22

14 Posts

Posted - 08/09/2018 :  12:02:57 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Win10

Hello guys,

I'm currently using a column user parameter in order to calculate column values. However if I am changing the user parameter it doesn't update the calculation. Is there any workaround for that via a labtalk script?

Regards Max

Hideo Fujii

USA
1582 Posts

Posted - 08/09/2018 :  2:29:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi maxm22,

Issuing the following command triggers all recalculation in the active worksheet:
run -auf 0 1;
Note that recalculation mode won't be set unless it has a reference to the other column even when it's a dummy one.

https://www.originlab.com/doc/LabTalk/ref/Run-cmd#-auf.3B_Trigger_all_recalculation

Hope this works.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 08/09/2018 2:32:49 PM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 08/09/2018 :  7:39:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I tried in 2018b the following and it works fine, so need more details on why it didn't work for you, as column label row changes should trigger recalculate.

1. add user parameter, so I can access the first using D1
2. fill column A with row numbers
3. put the following formula into column B.
A+value(A[D1]$)

I then see values in B filled in and I can change the values in my column A user parameter and see recalculate updated.

So can you put your user parameter on a column that is not your calculated column, which is considered the output and will not be considered for input change?

We do have a JIRA about this, ORG-18805, hopefully we can address this in our next version.

CP
Go to Top of Page

maxm22

14 Posts

Posted - 08/10/2018 :  11:34:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello guys,

thank you for your replies! It works indeed as mentioned by cpyang, however there is one issue left for me.
I am also using expressions like the following:

cell(1,2) = "=C1*0.01*value(A[D4]$)+(1-C1*0.01)*value(A[D1]$)";

And with that, updating the parameter D1 or D4 won't always change the cell value. Sometimes I have to re-enter the parameter D1/D4 several times in order to get an updated value in cell(1,2). Perhaps anyone knows a fix for that.

Regards Max
Go to Top of Page

Chris D

428 Posts

Posted - 08/10/2018 :  2:39:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi maxm22,

When this happens, try hitting F5 (which refreshes the window). Does that update the display of the calculated value?



Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

maxm22

14 Posts

Posted - 08/10/2018 :  3:48:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Chris D,

it's pretty much same with F5.

changing the value -> nothing happens
pressing F5 -> nothing happens
pressing F5 again -> cell value updates

There is also another weird thing I have noticed. When I am executing the following line

cell(1,2) = "=C1*0.01*value(A[D4]$)+(1-C1*0.01)*value(A[D1]$)";

directly with importing a file, the cell(1,2) doesn't show the corresponding int value but the string expression behind it (=C1*.... ). However when I am executing the line via the command window once I have imported my data, it will actually display the desired int value calculated from line above.

Regards Max
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 08/13/2018 :  12:32:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi maxm22,

We will fix the problem of unstable triggering with the change of the column header label by cleaning
the cache in the next release. We're sorry for the inconvenience caused by the bug.


ORG-18030-P2

--Hideo Fujii
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