使用列数据编写脚本表编辑嗨 - 如果这是微不足道,我道歉。
我已经从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));
最好
乌代