帮助使用循环在日志中添加数据表。嗨,我是 JMP 的新手。 我正在尝试将循环生成的表添加到日志中。 但运气不太好。 对此的任何帮助将不胜感激。 这是我的脚本。 我的初始表是通过运行 SQL qurey 生成的。
dt2 = dt<<总结(
组(:模块,:步骤),
频率(“无”),
重量(“无”)
);
ModuleList = Column(dt2,"MODULE")<<获取值;
StepList = Column(dt2,"STEP")<<获取值;
numrows=nrows(dt2);
关闭(dt2,nosave);
对于 (i=1, i<=numrows, i++,
dt<< select Where (:MODULE==ModuleList[i] & :STEP==StepList[i]);
odt= (dt << 子集(
输出表(ModuleList[i]),
选定的行(1),
仅选定的列(0)));
dt<< 清除选择;
jrn<<追加(文本框(模块列表[i])); //目前我只是将表格添加到日志中。
odt<<日志; //但是我想将它们添加为Collesapble窗口/ListBox,并以ModuleList[i]为标题。
关闭(odt,nosave);
);
回复:帮助使用循环在日志中添加数据表。代替 VListBox,使用 LineUpBox,如果表格标题的长度不同,这应该会有所帮助。
如果这些表不是同一个表的子集,这意味着这些表具有不同数量的列,我知道如何做到这一点的唯一方法是为每个表使用像 PanelBox 这样的容器。 找到最大的宽度,然后将每个面板框设置为相同的宽度。
希望 LineupBox 能满足您的所有需求。附上更改后的脚本。
回复:帮助使用循环在日志中添加数据表。你好@gzmorgan0 , 感谢你的回复。 解决方案很完美。 我只有一个问题。 有没有办法调整框(Outlinebox)的大小,以便框内的文本保持在一行中。
再次感谢您的时间和帮助。
回复:帮助使用循环在日志中添加数据表。这是 Journal 的屏幕截图,最后一张表已打开。

回复:帮助使用循环在日志中添加数据表。有多种方法可以做到这一点。 查找帮助 > 脚本索引 > DataTableColBox 以获取替代方法。
这是一种方法
Names Default to Here(1);
dt = Open("$sample_data/Big Class.jmp");
//get the group list
Summarize(Data Table(dt), grps = By(:sex, :age) );
show(grps); //List of 2 lists of equal size, the first list's items are gender, the second age
ob = OutlineBox("Subset Tables", vl=VListBox() );
For(i=1, i<=nitems(grps[1]), i++, //can also use grps[2]
ttl = EvalInsert("Sex = ^grps[1][i]^, Age = ^grps[2][i]^");
//note Summarize lists converts numeric to character so num() function is required
//If the grouping columns are character, this is not needed.
dt << Select Where(:sex==grps[1][i] & :age==num(grps[2][i]) );
odt= (dt << Subset( Invisible, Output Table( ttl ),
Selected Rows( 1 ),
Selected columns only( 0 ))
);
dg = odt << New Data Box();
tmp = OutlineBox( ttl, dg);
tmp << close(1);
vl << append(tmp);
dt << clear select;
); // end for
//ob hase a nice table like view of each subset, but once you close the tables the view is gone
//so journaling creates te report view, and the subsetted tables can be closed.
nw = New Window("Tables", <<JOURNAL></JOURNAL>