大家好,
我正在嘗試根據 for 循環中的特定列值來製表多種情況。
categorizes = Column(dt, "Categorize");
columnValues = Associative Array(categorizes << Get Values) << Get Keys;
For(i = 1, i <= N Items(columnValues), i++,
currentItem = columnValues[i];
obLoopY = Outline Box("categorize" || Char(currentItem),
dt << Tabulate(
Page Column(:Categorize(Char(currentItem))),
Show Control Panel(0),
Add Table(
Column Table(
Grouping Columns(:Underlayer, :RefEntity),
Analysis Columns(:M3S_Y)
),
Row Table(Grouping Columns(:TargetEntity))
),
SendToReport(Dispatch({}, "", TextBox, {Set Base Font("Heading")}))
)
);
boxY << append(obLoopY);
);
問題是,currentItem 包含來自 Categorize 欄位的 columnValues。
如果我僅指定項目值,則假設「a」是columnValues之一。
我將頁面列(:Categorize(“a”))加入到 Tabulate 方法中,然後它就可以工作了。
但是我需要從 for 循環運行所有值,我嘗試將其設為Page Column(:Categorize(currentItem)),但它不起作用,只是一次給我整個值而不是按 currentItem 拆分。
我試過Page Column( :Categorize( currentItem ) ) 和 Page Column( :Categorize( char(currentItem) ) ),但都沒用。或許有更簡單的解決方案,但我沒找到。
有人可以幫忙嗎?
先致謝
編輯(jthi):新增了 jsl 格式
您可能需要評估這些值,以下是使用 JMP 範例表的範例
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Summarize(dt, groups = By(:sex));
New Window("test",
collector = H List Box()
);
For Each({group}, groups,
ob = Outline Box("Categorize " || group,
tab = dt << Tabulate(
Show Control Panel(0),
Add Table(
Column Table(Analysis Columns(:height, :weight), Statistics(Mean)),
Row Table(Grouping Columns(:age))
)
);
Eval(EvalExpr(
tab << page column(:sex(Expr(group)));
));
);
collector << Append(ob);
);

如果佈局沒問題,By 可能也是一個選擇
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
tab = dt << Tabulate(
Show Control Panel(0),
Add Table(
Column Table(Analysis Columns(:height, :weight), Statistics(Mean)),
Row Table(Grouping Columns(:age))
),
By(:sex),
Group Options(Layout("Horizontal List"))
);
