使用列數據編寫腳本表編輯嗨 - 如果這是微不足道,我道歉。
我已經從Sublot Control Data創建了一個表SublotList,它是一個Sublots列,它們是混合的字母數字,直到拉出原始表才知道。 我想使用SublotList第一行中的Sublot,並在Select Where語句和Output Table名稱中使用它。然後我想逐步瀏覽所有Sublots並在我使用最後一個Sublot時退出。 粗略地說,我手動輸入“-A”,- A,“ - L22”或-L22等。在許多選擇和命名語句中,並希望從單獨的表中使用這些值。我確定這個問題尚未完全形成,請提出問題。謝謝。
DT1 << 選擇Where ( : 子批次 == “-一個” ) ;
數據表 ( “子目錄控制數據” ) <<
子集 (
輸出表 ( “-A子節點控制數據” ) ,
選定的行 ( 1 ) , ,
僅選定列 ( 0 )) ;
Re:使用列數據編寫腳本表編輯下面是一個使用Joining和Subsetting的方法,該子句執行所需的By子句
Names Default to Here(1);
dtMain=data table("Sublot Control Data");
dtList=data table("Sublot List");
dtTogether = dtMain << Join(
With( dtList ),
Merge Same Name Columns,
By Matching Columns( :SubLot = :SubLot ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 )
);
dtTogether << delete columns("Match Flag");
dtFinal = dtTogether << Subset(
By( :SubLot ),
selected columns( 0 ),
selected rows( 0 )
);Re:使用列數據編寫腳本表編輯嗨,Uday,很棒 - 這正是我所需要的!乾杯!坦率Re:使用列數據編寫腳本表編輯 @fwissman ,
在這裡,我認為這就是你所追求的。讓我知道 :
// Define Paths (edit this as needed)
SubLotControlFilePath = "C:\Users\Sublot Control Data.jmp"
SublotListFilePath = "C:\Users\Sublot List.jmp" ;
// Open Files
dt_SublotControl = Open(SubLotControlFilePath);
dt_SublotList = Open(SublotListFilePath);
// Get List of sublots
SubLotList = dt_SublotList:SubLot << Get Values;
// If you want to select all rows where sublots match sublot list
dt_SublotControl << Select Where(Contains(SubLotList,:SubLot));
// If you instead want to select rows based on subplot one after the other
for( i = 1 , i <= N Items(SubLotList) , i++,
dt_SublotControl << Select Where(:SubLot == SubLotList[i]);
dt_Temp = dt_SublotControl << Subset("");
dt_Temp << set Name(Concat("Subplot-",SubLotList[i]));
);Re:使用列數據編寫腳本表編輯嗨,Uday,這是我的原始表,Sublot Control Data和我的派生表Sublot List。請注意我想使用Sublot List中的所有條目。Re:使用列數據編寫腳本表編輯你好 @fwissman :
您可以上傳您正在使用的數據表的子集嗎?我認為這個問題可以解決。
如果我正確理解您的問題,您基本上想要在數據表中選擇行,但選擇條件基於表中列的值。
如果這是正確的 - 看看以下是否有幫助,否則上傳樣本數據,我會嘗試回答你的問題。
我正在使用“幫助”下的示例數據中的“Airline Delays”數據表
// Select the data table you want to work with
dt = Current Data Table();
// Get as list the values in the column
DaysOfMonth = As List(dt:Day of Month << get Values());
// Specify the sublist in your case sublots that you want to select
DesiredDays = {1,5,7};
// Select the rows that match the criteria by wrapping in Contains
dt << Select Where(Contains(DesiredDays,:Day of Month));
最好
烏代