幫助使用循環在日記中添加數據表。大家好,我是 JMP 的新手。 我正在嘗試將循環生成的表添加到日誌中。 但運氣並不好。 任何對此的幫助將不勝感激。 這是我的腳本。 我的初始表是通過運行 SQL 查詢生成的。
dt2 = dt<<摘要(
組(:模塊,:步驟),
頻率(“無”),
重量(“無”)
);
ModuleList = Column(dt2,"MODULE")<<獲取值;
StepList = Column(dt2,"STEP")<<獲取值;
行數= n行(dt2);
關閉(dt2,nosave);
對於 (i=1, i<=行數, i++,
dt<< select 其中 (:MODULE==ModuleList[i] & :STEP==StepList[i]);
odt= (dt << 子集(
輸出表( ModuleList[i] ),
選定的行( 1 ),
僅選定的列( 0 )));
dt<< 清除選擇;
jrn<< Append(文本框(ModuleList[i])); //目前我只是將表格添加到日誌中。
odt<< 期刊; //但是我想將它們添加為 Collesapble 窗口/ListBox,並以 ModuleList[i] 作為標題。
關閉(odt,nosave);
);
回复:幫助使用循環在日誌中添加數據表。使用 LineUpBox 代替 VListBox,如果表標題的長度不同,這應該會有所幫助。
如果這些表不是同一個表的子集,這意味著這些表具有不同數量的列,我知道如何做到這一點的唯一方法是為每個表使用像 PanelBox 這樣的容器。 找到最大寬度,然後將每個面板框設置為相同的寬度。
希望 LineupBox 能夠滿足您的所有需求。更改後的腳本附後。
回复:幫助使用循環在日誌中添加數據表。你好@gzmorgan0 , 感謝你的回复。 解決方案非常完美。 我只有一個問題。 有沒有一種方法可以調整框(Outlinebox)的大小,以便框內的文本保持在一行中。
再次感謝您的時間和幫助。
回复:幫助使用循環在日誌中添加數據表。這是日記的屏幕截圖,其中打開了最後一個表格。

回复:幫助使用循環在日誌中添加數據表。有多種方法可以做到這一點。 查找“幫助”>“腳本索引”>“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>