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
 Worksheet query (recalculation)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MatthiasW

Germany
6 Posts

Posted - 04/10/2018 :  11:59:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,
I wanted to ask if it's possible to recalculate the extracted data (worksheet query) if it's changed.
I'm not able to apply if I turn the "Recalculate" dropdown on manuel or auto.

Thanks in advance
Matthias

Hideo Fujii

USA
1582 Posts

Posted - 04/10/2018 :  2:51:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Matthias,

Worksheet Query doesn't provide the recalculation mechanism, but you can try the following work-around.

Make a dummy column which "watches" the value change of a column, and triggers wextract x-function command.
(See: https://www.originlab.com/doc/X-Function/ref/wextract)
See the sample screenshot below:



Here, column C is the dummy for triggering, and it has the Set Column Values settings - no actual
calculation body, but the "Before Formula Scripts" which has the wextract command:

wextract iy:=[Book1]1!col(A) settings.stAlias.Cols:=1 settings.stAlias.AliasNames:=A settings.stCondition.Condition:="A<0.5" settings.cols:="0|1";
Book2 and Book3 are the extracted results before and after the change in column A.

Hope this helps.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 04/10/2018 2:52:00 PM
Go to Top of Page

MatthiasW

Germany
6 Posts

Posted - 04/12/2018 :  08:22:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for your answer!
This is working out well in my case.
But I have another problem, doing it with that way.
If I change the data right now, it's producing new windows for the extracted data and I would like to have the recalculated data in the same worksheet as before. Is this possible?

Thanks in advance
Matthias
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 04/13/2018 :  4:52:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Matthias,

> I would like to have the recalculated data in the same worksheet as before.

To output the extracted data in the new sheet in the same workbook, you can set the output destination by "iy:=" option like:
wextract iy:=[Book1]1!col(A) settings.stAlias.Cols:=1 settings.stAlias.AliasNames:=A settings.stCondition.Condition:="A<0.5" settings.cols:="0|1" oy:=<new>!<new>;

To add the extracted columns in the source worksheet, you can put a script like:
wextract iy:=[Book1]1!col(A) settings.stAlias.Cols:=1 settings.stAlias.AliasNames:=A settings.stCondition.Condition:="A<0.5" settings.cols:="0|1" oy:=<new>!<new>;
sheetno=page.active;  //Sheet number
copydata irng:=1!1:2 orng:=[Book1]Sheet1!<new>;  //Copy data to original sheet
page.active=sheetno;  //Go back to the extracted sheet
layer -d;  //Remove extracted sheet
Hope this helps.

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