你好
假設我們有主數據表,還有另一個數據表我們想用來對主要數據表進行子集化+在此過程中添加一些條件;
主表

另一個數據表

當group == K和Number == 2時,如何遍歷主表的Label列的每一行以獲取與子表行(L1,L3,L5)匹配的行並獲取行
所以輸出表應該看起來像

請為解決方案提供for循環或任何其他可用的方法,並且不要使用像list = {K1,K3,K5}之類的簡短列表,因為在我的真實數據中,我有1000行。
https://community.jmp.com/t5/Discussions/How-to-select-rows-based-on-multiple-criteria/td-p/7014
這是做您想要的一種方式的示例。
我建議您花些時間閱讀“幫助”下拉菜單下的“ JMP文檔庫”中的“使用JMP和腳本指南”文檔。它將打開使用JMP中對象的各種方式的窗口,而不僅限於認為每件事都需要使用傳統的編程方法進行編碼。
names default to here(1);
dt1=data table("main_table");
dt2=data table("subset_table");
dt2b = dt2 << subset(selected rows(0), columns(:label));
dtFinal = dt1 << Join(
with(dt2b),
Match Flag( 1 ),
By Matching Columns( :Label = :Label ),
Drop multiples( 0, 0 ),
Include Nonmatches( 1, 1 ),
Preserve main table order( 1 ),
merge same name columns( 1 )
);
close( dt2b, nosave );
dtFinal << select where(:match flag == 3 | (:Group == "K" & :Number == 2) );
dtFinal << invert row selection;
dtFinal << delete rows;優秀的! 我必須在某些時候發表評論。 手冊還不夠。 我仔細閱讀了手冊,沒有一個很好的例子可以解決我的問題。 您是否有更好的資料來源,我們可以找到這些功能的一些用例?