cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Ohad_s
Level III

script to subset selected rows

Hi,

I have the following script:

I Want to select some rows and subset them.

selection finds 369 rows, but subset only 140 rows.

Does someone have any idea what I am missing?

 

dt = Current Data Table();
Column(dt, "DieX") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
Column(dt, "DieY") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
dt << select where(
	1045 <= :DieX <= 1055 & 1221 <= :DieY <= 1228 
	| 1145 <= :DieX <= 1155 & 1221 <= :DieY <= 1228 
	| 1045 <= :DieX <= 1055 & 770 <= :DieY <= 778 
	| 1145 <= :DieX <= 1155 & 770 <= :DieY <= 778
);
dt_subset = dt << subset(output table("Defects"), selected rows(1));
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: script to subset selected rows

For me it seems to subset correct amount of rows (369) (I made slight modifications to your script, but even the original did subset correct amount of rows)

Names Default To Here(1);

dt = Open("$DOWNLOADS/Setup2_0_2_Surface.jmp");
dt << clear select << Clear Column Selection;

Column(dt, "DieX") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
Column(dt, "DieY") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
dt << select where(
	1045 <= :DieX <= 1055 & 1221 <= :DieY <= 1228 
	| 1145 <= :DieX <= 1155 & 1221 <= :DieY <= 1228 
	| 1045 <= :DieX <= 1055 & 770 <= :DieY <= 778 
	| 1145 <= :DieX <= 1155 & 770 <= :DieY <= 778
);
dt_subset = dt << subset(output table("Defects"), selected rows(1), Selected Columns(0));
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: script to subset selected rows

For me it seems to subset correct amount of rows (369) (I made slight modifications to your script, but even the original did subset correct amount of rows)

Names Default To Here(1);

dt = Open("$DOWNLOADS/Setup2_0_2_Surface.jmp");
dt << clear select << Clear Column Selection;

Column(dt, "DieX") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
Column(dt, "DieY") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
dt << select where(
	1045 <= :DieX <= 1055 & 1221 <= :DieY <= 1228 
	| 1145 <= :DieX <= 1155 & 1221 <= :DieY <= 1228 
	| 1045 <= :DieX <= 1055 & 770 <= :DieY <= 778 
	| 1145 <= :DieX <= 1155 & 770 <= :DieY <= 778
);
dt_subset = dt << subset(output table("Defects"), selected rows(1), Selected Columns(0));
-Jarmo
Ohad_s
Level III

Re: script to subset selected rows

Thank you!

 

Recommended Articles