I strongly suggest checking out JMP Scripting Index, JMP help https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/select-rows-2.shtml# and JMP Scripting Guide https://www.jmp.com/content/dam/jmp/documents/en/support/jmp151/scripting-guide.pdf
You could first check out how JMP would do it from Select Where menu:
Fill out dialog:
And from red triangle you can copy the code:
Script:
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(102),
Compress File When Saved(1),
New Script(
"Subset Script",
Data Table("Untitled") << Subset(
Selected Rows(0),
Rows([18, 23, 33, 38, 39, 50, 69, 74, 84, 89, 90, 101]),
Selected columns only(0)
)
),
New Column("LOT",
Character,
"Nominal",
Set Values(
{"LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01",
"LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01",
"LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01",
"LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01",
"LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "LL01",
"LL01", "LL01", "LL01", "LL01", "LL01", "LL01", "XY02", "XY02", "XY02",
"XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02",
"XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02",
"XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02",
"XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02",
"XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02", "XY02",
"XY02", "XY02", "XY02"}
)
),
New Column("SITE",
Character(16),
"Nominal",
Set Values(
{"XY001", "XY002", "XY003", "XY004", "XY005", "XY006", "XY007", "XY008",
"XY009", "XY010", "XY011", "XY012", "XY013", "XY014", "XY015", "XY016",
"XY017", "XY018", "XY019", "XY020", "XY021", "XY022", "XY023", "XY024",
"XY025", "XY026", "XY027", "XY028", "XY029", "XY030", "XY031", "XY032",
"XY033", "XY034", "XY035", "XY036", "XY037", "XY038", "XY039", "XY040",
"XY041", "XY042", "XY043", "XY044", "XY045", "XY046", "XY047", "XY048",
"XY049", "XY050", "XY051", "XY001", "XY002", "XY003", "XY004", "XY005",
"XY006", "XY007", "XY008", "XY009", "XY010", "XY011", "XY012", "XY013",
"XY014", "XY015", "XY016", "XY017", "XY018", "XY019", "XY020", "XY021",
"XY022", "XY023", "XY024", "XY025", "XY026", "XY027", "XY028", "XY029",
"XY030", "XY031", "XY032", "XY033", "XY034", "XY035", "XY036", "XY037",
"XY038", "XY039", "XY040", "XY041", "XY042", "XY043", "XY044", "XY045",
"XY046", "XY047", "XY048", "XY049", "XY050", "XY051"}
)
),
New Column("Data",
Numeric,
"Continuous",
Format("Best", 12),
Set Values(
[0.546728, 0.055965, 0.303851, 0.858696, 0.089441, 0.6769, 0.764777,
0.232966, 0.464361, 0.647894, 0.197118, 0.824098, 0.288582, 0.758274,
0.360068, 0.996029, 0.557039, 0.579821, 0.84759, 0.5814, 0.249923,
0.126439, 0.815976, 0.340023, 0.228621, 0.356278, 0.815186, 0.483265,
0.950447, 0.397944, 0.179747, 0.892906, 0.831573, 0.207603, 0.644884,
0.557065, 0.00514, 0.692865, 0.793528, 0.545025, 0.908561, 0.020471,
0.656038, 0.785081, 0.426485, 0.331112, 0.158288, 0.025213, 0.262702,
0.373579, 0.440254, 0.163887, 0.371756, 0.403243, 0.003273, 0.487236,
0.137888, 0.29748, 0.955243, 0.012711, 0.576878, 0.944287, 0.776797,
0.158493, 0.598779, 0.714543, 0.29589, 0.969492, 0.086959, 0.046462,
0.037904, 0.360544, 0.534296, 0.35869, 0.380169, 0.17056, 0.012633,
0.59057, 0.716395, 0.136862, 0.849967, 0.17172, 0.870706, 0.415646,
0.434663, 0.588884, 0.845628, 0.831929, 0.149653, 0.222923, 0.383863,
0.965367, 0.019468, 0.968852, 0.418934, 0.122715, 0.705794, 0.882526,
0.836149, 0.330755, 0.21195, 0.474435]
)
)
);
/*
//Select where solution from JMP:
dt << Row Selection(
Select where(
:SITE == "XY018" | :SITE == "XY023" | :SITE == "XY033" | :SITE == "XY038" |
:SITE == "XY039" | :SITE == "XY050"
)
);
*/
//easier to maintein solution with list
sitelist = {"XY018", "XY023", "XY033", "XY038", "XY039", "XY050"};
dt << Select Where(ContainsItem(:SITE, sitelist));
//subset
dt << Subset(Outputtable("newtable"), Selected Rows, Selected columns only(0));
-Jarmo