加入问题:时间戳范围,有点像?<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)是否对应同一个物理晶圆?