使用可变数量的列来连接数据表您好 - 我正在尝试将连接作为脚本的一部分。 然而,“select”和“selectwith”部分让我很困惑。 我在脚本前面动态选择链接数据表的列,并将它们作为列表传递给“选择”和“选择方式”部分。 我尝试了 Eval(Eval Expr(Expr())),但这不起作用。 我想我只是误解了这两个人实际获取信息的方式。
Data Table(dt2b) << Join(
With(Data Table("Experimental Info")),
Match Flag(1),
Select(selectedCols1String),
SelectWith(selectedCols2String),
By Matching Columns(:ID = :ID),
Drop multiples(0, 0),
Include Nonmatches(0, 0),
Preserve main table order(1)
);selectedCols1String 和 selectedCols2String 的输出如下所示:“:ID, :2Theta, :Data, :Error, :Raw Data, :Raw Error”
谢谢!
自动化和脚本编写视窗回复:使用可变数量的列来连接数据表你不应该使用字符串,而应该使用列表并使用 Eval
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Trial1.jmp");
dt2 = Open("$SAMPLE_DATA/Little.jmp");
select_cols = {"popcorn", "oil amt", "batch", "yield"};
with_cols = {"yield", "batch"};
dt3 = dt << Join(
With(dt2),
Select(Eval(select_cols)),
SelectWith(Eval(with_cols)),
By Matching Columns(:popcorn = :popcorn, :batch = :batch, :oil amt = :oil)
);
这里我使用的是字符串列表,但这些也可以是列表引用
查看更多...
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Trial1.jmp");
dt2 = Open("$SAMPLE_DATA/Little.jmp");
select_cols = {:popcorn, :oil amt, :batch, :yield};
with_cols = {:yield, :batch};
dt3 = dt << Join(
With(dt2),
Select(Eval(select_cols)),
SelectWith(Eval(with_cols)),
By Matching Columns(:popcorn = :popcorn, :batch = :batch, :oil amt = :oil)
);
回复:使用可变数量的列来连接数据表太感谢了!