满足条件后如何执行JSL命令尊敬的 JMP 社区用户:
我是 JMP 的新手,我一直面临一个问题。 希望我能得到你们的帮助。
我有一个数据表。 我只想为某些特定值的列运行图形构建器。
例如,我想选择属于 AB766 和 RSDF 列“monitor_set_name”和“measurement_set_name”的单元格;以及对应于“AB766”和“RSDF”的其他列和行

然后,我想为包含我需要的信息的表运行“Graph builder”。
如果“monitor_set_name”和“measurement_set_name”不包含“AB766”和“RSDF”,我将跳过运行“graph builder”
你能给我一些建议吗?
真挚地,
数据表脚本编写Re: 满足条件后如何执行JSL命令为了生成下面的 JSL,我只是以交互方式运行这些步骤,然后从日志中抓取代码并将其粘贴到脚本窗口中。
names default to here(1);
// Open Data Table: big class.jmp
// → Data Table( "big class" )
Open( "$SAMPLE_DATA/big class.jmp" );
// Select matching cells
Data Table( "big class" ) << Select Where( :age == 12 & :sex == "F" );
// Subset data table
// → Data Table( "Subset of big class" )
Data Table( "big class" ) << Subset( Selected Rows( 1 ), Selected columns only( 0 ) );
// Report snapshot: Subset of big class - Graph Builder
Data Table( "Subset of big class" ) << Graph Builder(
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
// Invert current selection
Data Table( "big class" ) << Invert Row Selection;
// Subset data table
// → Data Table( "Subset of big class 2" )
Data Table( "big class" ) << Subset( Selected Rows( 1 ), Selected columns only( 0 ) );
// Report snapshot: Subset of big class 2 - Graph Builder
Data Table( "Subset of big class 2" ) <<
Graph Builder(
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) )
);
Re: 满足条件后如何执行JSL命令你好,
如果您不熟悉 JMP,请务必查看本地数据过滤器和列切换器。 本地数据过滤器可能会在这里帮助您... 我在示例中包含了一个列切换器,只是为了让您知道它可以做什么。
只需单击菜单项即可将图表限制为您希望考虑的数据。 不需要编码,而且很容易使用……任何人都可以使用这些。
要获取本地数据过滤器,请从图形生成器的红色小三角菜单中选择添加本地数据过滤器。
要获得列切换器,请从主菜单中选择重做 > 列切换器。 您还必须选择要换出的列,以及要在其中旋转的列。 确保在此集合中包含要换出的列。 所有列必须具有相同的数据类型。
运行下面的脚本以了解这些操作。
干杯,
布雷迪

Names Default To Here(1);
dt = open ("$Sample_Data\Car Physical Data.jmp");
Graph Builder(
Size( 526, 448 ),
Show Control Panel( 0 ),
Variables( X( :Country ), Y( :Gas Tank Size ) ),
Elements( Box Plot( X, Y, Legend( 8 ) ), Points( X, Y, Legend( 9 ) ) ),
Local Data Filter(
Show Histograms and Bars( 0 ),
Add Filter(
columns( :Type ),
Where( :Type == "Compact" ),
Display( :Type, N Items( 5 ) )
)
),
Column Switcher(
:Gas Tank Size,
{:Weight, :Turning Circle, :Displacement, :Horsepower, :Gas Tank Size}
)
);
Re: 满足条件后如何执行JSL命令亲爱的特克斯尼尔森,
有用。 很欣赏。
我尝试遵循您的指导并将其应用于自己
dt = Open( "raw_data.csv", "invisible" );
dt << Select Where(
:monitor_set_name == "CSP_FAST_TC" & :spc_chart_subset == "STDDEV" & :measurement_set_name == "U1_X"
);
df = dt << Subset( Selected Rows( 1 ), Selected columns only( 0 ), "invisible" );
df << Graph Builder(
Size( 1056, 675 ),
Show Control Panel( 0 ),
Automatic Recalc( 0 ),
Variables(
X( :spc_txn_date ),
Y( :chart_value ),
Y( :lo_control_lmt, Position( 1 ) ),
Y( :up_control_lmt, Position( 1 ) ),
Y( :centerline, Position( 1 ) ),
Group Y( :monitor_set_name ),
Group Y( :measurement_set_name ),
Group Y( :spc_chart_subset ),
Wrap( :spc_entity )
),
Elements(
Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Legend( 25 ), Connection( "Curve" ), Smoothness( 0.5 ) )
),
SendToReport(
Dispatch( {}, "spc_txn_date", ScaleBox, {Label Row( Automatic Font Size( 0 ) )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
25,
Properties( 2, {Line Color( 19 )} ),
Properties( 3, {Line Color( 0 ), Line Style( "Dotted" )} )
)}
)
)
);
df << save picture( "C:\Users\lamquocb\image.jpg" );
但是,我遇到了另一个问题,我无法为 df 保存图片 - 图形生成器。
我尝试访问要存储图片的位置,但找不到。
你有什么建议吗?
真挚地,
Re: 满足条件后如何执行JSL命令您的变量“df”指向子集数据表。从数据表创建报告时,它不会成为数据表的一部分。它本身就是一个实体。因此,访问创建的报告的最简单方法是指定一个变量来指向它。我在您的脚本的以下修改中完成了此操作。
gb = df << Graph Builder(
变量“gb”指向Graph Builder 对象。稍后在代码中,将保存图片消息应用于Graph Builder 平台生成的报告
report(gb) << save picture( "C:\Users\lamquocb\image.jpg" );
这是修改后的脚本
names default to here( 1 );
dt = Open( "raw_data.csv", "invisible" );
dt << Select Where(
:monitor_set_name == "CSP_FAST_TC" & :spc_chart_subset == "STDDEV" & :measurement_set_name == "U1_X"
);
df = dt << Subset( Selected Rows( 1 ), Selected columns only( 0 ), "invisible" );
gb = df << Graph Builder(
Size( 1056, 675 ),
Show Control Panel( 0 ),
Automatic Recalc( 0 ),
Variables(
X( :spc_txn_date ),
Y( :chart_value ),
Y( :lo_control_lmt, Position( 1 ) ),
Y( :up_control_lmt, Position( 1 ) ),
Y( :centerline, Position( 1 ) ),
Group Y( :monitor_set_name ),
Group Y( :measurement_set_name ),
Group Y( :spc_chart_subset ),
Wrap( :spc_entity )
),
Elements(
Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Legend( 25 ), Connection( "Curve" ), Smoothness( 0.5 ) )
),
SendToReport(
Dispatch( {}, "spc_txn_date", ScaleBox, {Label Row( Automatic Font Size( 0 ) )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
25,
Properties( 2, {Line Color( 19 )} ),
Properties( 3, {Line Color( 0 ), Line Style( "Dotted" )} )
)}
)
)
);
report(gb) << save picture( "C:\Users\lamquocb\image.jpg" );
我强烈建议您花时间阅读 JMP 文档库中的脚本指南,该指南位于帮助下拉菜单下!