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
 Maximum and Table for large amount of data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

luckyluc22

4 Posts

Posted - 07/01/2021 :  10:48:32 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2019 (64-bit)
9.6.0.172 (Academic)
Operating System: Windows 10

Hi,
I have a workbook with 928 worksheets, each containing 2 columns (A(X) and B(Y)). In a new worksheet, I want one column with with the maximum Y-value of sheets 1 through 928 (so 928 rows with =max(1!B) through =max(928!B)). In a second column, I want the corresponding X-values of those maximum Y-values (so =table(1!B, 1!A, max(1!B)) through =table(928!B, 928!A, max(928!B)). I don't know how to do this without having to retype the worksheet numbers 928 times. Can somebody help me with this?
Thanks in advance,
Luc

YimingChen

1685 Posts

Posted - 07/01/2021 :  12:35:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try the Labtalk script below:

Dataset dsx, dsy;
dsx.SetSize(page.nlayers);
dsy.SetSize(page.nlayers);
int i = 1;

doc -e LW {
	range rx = 1;
	range ry = 2;
	double max = max(ry);
	dsy[i] = max;
	dsx[i] = table(ry, rx, max);
	i = i + 1;
}

newbook;
col(A) = dsx;
col(B) = dsy;


James
Go to Top of Page

luckyluc22

4 Posts

Posted - 07/02/2021 :  06:21:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Try the Labtalk script below:

Dataset dsx, dsy;
dsx.SetSize(page.nlayers);
dsy.SetSize(page.nlayers);
int i = 1;

doc -e LW {
	range rx = 1;
	range ry = 2;
	double max = max(ry);
	dsy[i] = max;
	dsx[i] = table(ry, rx, max);
	i = i + 1;
}

newbook;
col(A) = dsx;
col(B) = dsy;


James



Thank you! This worked perfectly.
Luc
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