你好,
我一直在創建一個應用程序,該應用程序涉及用戶選擇用於構建模型的列,用於選擇 PQA,通過使用模態窗口,如附件 JMP 文件中的玩具數據和腳本,標題為“選擇 PQA 的模型和列”。
該模型應該為為具有任何列名拼寫的任何數據集選擇的每個 PQA 創建自定義輸出。 運行腳本時,會彈出一個彈出窗口,要求用戶選擇特定的列。 該窗口如下圖所示:

下一個窗口要求用戶設置 PQA、存儲條件,並詢問用戶是否要查看每個 PQA 的子集數據集 - 存儲條件。 也就是說,對於每個選擇的 PQA,都會在後台創建一個子集數據集。 然後,生成模型和圖形結果,然後在 for 循環的每次迭代中將其附加到帶有自定義和格式化數據的窗口(帶有 LSL 和 USL y 軸線和帶有測量值的 y 軸標籤)。

下面是 JSL 腳本代碼,它在給定上述窗口的用戶輸入的情況下產生輸出:
//select the data in the original data table
Names Default To Here( 1 );
dt = Current Data Table();
//get the unique PQAs
col9 = Column(dt, "PQA");
unique_pqa = Associative Array( col9 ) << get keys;
/////////////////////////////////////////////////////////////
//User Selection Menu(s)
/////////////////////////////////////////////////////////////
//Part 1: ask user for column names in a new window nw1
//possible Group column name (should be character)
character_col_names = dt << Get Column names(character, String);
//possible result column name (should be numeric)
numeric_col_names = dt << Get Column names(Numeric, String);
nw1 = New Window("Column names",
<<MODAL></MODAL>
創建輸出窗口後,我希望能夠將腳本保存到原始數據表中,其中包含所有數據(子集數據所依賴的數據)。 但是,當我將所有輸出的腳本保存到腳本窗口時,我得到以下結果:
注意
Where ( :PQA == pqa_val & column(listDT, set_storage_condition_col) == selected_stor_cond )
語句不允許腳本工作。
我希望此腳本中的此語句具有特定的輸出。 例如,在我附上的玩具數據集中,
column(listDT, set_storage_condition_col)
等於:儲存情況
此外,如果我選擇 A 作為pqa_val ( 以便:PQA == "A" ) 和 5C 作為selected_stor_cond (以便:儲存條件 == "5C" )。
但是,即使我指的是用戶輸入,生成的輸出腳本也不存在。 為什麼 JMP 不將上述示例中的這些值寫入循環中每個特定實例的腳本中?
使用 Eval Insert、Eval Expr、Parse 和 Substitute 將一個表達式插入另一個表達式應該可以幫助你。 當您使用模態窗口時,按下按鈕也不需要 << 關閉窗口。
我在 where 語句周圍和內部添加了一個 Eval(EvalExpr()) 和幾個 Expr()。:
查看更多...
//select the data in the original data table
Names Default To Here(1);
dt = Current Data Table();
//get the unique PQAs
col9 = Column(dt, "PQA");
unique_pqa = Associative Array(col9) << get keys;
/////////////////////////////////////////////////////////////
//User Selection Menu(s)
/////////////////////////////////////////////////////////////
//Part 1: ask user for column names in a new window nw1
//possible Group column name (should be character)
character_col_names = dt << Get Column names(character, String);
//possible result column name (should be numeric)
numeric_col_names = dt << Get Column names(Numeric, String);
nw1 = New Window("Column names",
<<MODAL></MODAL>
非常感謝。 我什至沒有考慮過使用 Eval() 和相關的。 我一定會閱讀更多有關此內容的信息,並會查看您提供的鏈接。