滿足條件後如何執行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 文檔庫中的腳本指南,該指南位於幫助下拉菜單下!