加入問題:時間戳範圍,有點像?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />所以我有一個問題,關於如何進行連接以使行在某種程度上與其相似的時間戳相匹配。
我有兩張表,一張用於缺陷數據,一張用於通過工具計算晶圓數量。時間戳不匹配,並非一張表中測量的每個晶圓都記錄在另一張表中。
關於如何加入此表以實現繪製缺陷數與晶圓數的最終目標的任何提示?
========
160 萬行,約 6 個月的數據
表 1 - 缺陷數據
僅在一小部分晶圓樣本上測量缺陷數據。
僅用於輸入/輸出的時間戳,因此整個批次的時間戳

表 2 - 晶圓數量
單個晶圓時間戳,用於更大的晶圓採樣。
每個晶圓的獨特時間戳

回复:加入問題:時間戳範圍,有點像?謝謝!
回复:加入問題:時間戳範圍,有點像?感謝文斯分享代碼! 這非常有幫助!
我想知道是否有一種方法可以按最近的日期/時間連接兩個表,並按其他方式分組,例如,在本例中為 Tool_ch。 我一直在通過對兩個表中的相同元素進行子集化來做到這一點,然後按最近的日期加入,並將所有內容合併在一起。 我認為這不是執行此操作的有效方法。 
謝謝~
鵬
回复:加入問題:時間戳範圍,有點像?因此,您在兩個表中都創建了一個名為任意名稱的列。
一個表,dt1,您創建一個行列,它只是行號。然後,您可以將值作為您嘗試加入的任何列的矩陣。
mat = Column(dt1, "Column with the information you want to join") << Get Values;
然後使用以下公式在另一個表 (dt2) 中創建一列:
Loc Min( Abs( Column( dt2, "Other Join Column" )[Row()] - mat ) );
這將為您提供 dt2 中的當前行與 dt1 的整組值之間的最小差異的位置(行)。
然後你只需將兩列連接在一起。
回复:加入問題:時間戳範圍,有點像?驚人的!我需要仔細研究一下……我對此還是陌生的,並試圖一瘸一拐地前進。
是否有適用於我可以設置的示例數據表?
因此在 DT1 和 DT2 中創建一個新列,“Loc Min”
然後通過匹配新表中的兩列來連接
回复:加入問題:時間戳範圍,有點像?Graham Blatz 在今年 JMP 會議的高級腳本會議上實際上談到了這件事。我有他不久前的代碼,但他實際上通過使用 KDTable() 對其進行了改進,這使得它非常快。
下面是執行最重要部分的函數片段。
dt2 << New Column( "Loc Min", numeric, continuous, formula( Row() ) ); //indexing, basically, to match/update upon
list_big = Column( dt2, rt2 ) << get values; //creates a vector of values for the following
dt1 << New Column( "Loc Min",
numeric,
continuous,
formula(
Loc Min( Abs( Column( rt1 )[Row()] - list_big ) )
)
); //simple, but fast. Very fast.
dt_join = dt1 << Join(
With( dt2 ),
By Matching Columns( :Loc Min = :Loc Min ),
Drop multiples( 0, 1 ),
Name( "Include non-matches" )(0, 0),
Preserve main table order( 1 )
); // I opted for a join rather than an update, for now. may change in the future.
Here's the actual function as well that you can call and has a UI with it.
nearest_neighbor = Function(
//by Graham Blatz
//2/20/15
//Matches Nearest Neighbor of ostensibly dates, but whatever, man
{dt1 = Current Data Table(),
dt2 = Current Data Table(), rt1 = "ReadTime", rt2 = "ReadTime"
},
{DEFAULT LOCAL},
If( dt1 == dt2, //default execution of a prompt, dunno a clean way around this without making some user camp inconvenienced.
list_tables = {};
For( i = 1, i <= N Table(), i++,
Insert Into( list_tables, Data Table( i ) << get name );
); //sets up names of data tables to pick from
dt1 = Data Table( list_tables[1] );
dt2 = Data Table( list_tables[2] ); //Reasonable Starting point
win_tableselect = New Window( "Select Tables",
<<MODAL></MODAL>
回复:加入問題:時間戳範圍,有點像?是的,對不起。應該用WID。我可以假設物理插槽值會保留下來。表1中的L11 Slot4與表2中的L11 Slot4相同。
我還有幾個其他匹配列可用於提高連接準確性,例如操作#、工藝配方、產品類型等。
回复:加入問題:時間戳範圍,有點像?我假設始終保持批次完整性,但晶圓是否曾在插槽之間洗牌過? 換句話說,表1的第4行(L22,W10)和表2的第18行(L22,W10)是否對應同一個物理晶圓?