按行合併數據你好,
我正在嘗試執行以下操作:
給定產品列和批次列,我需要建立「產品中的批次」列,以便它結合基於相同產品的所有「批次」。

最終目的是得到Tabulate:

X1、X2、X3、X4 不必出現在單一儲存格中,這也可以工作(以更容易的為準):

當我有一個包含數千個數據點的表時,手動執行此過程是瘋狂的。
太感謝了!
JMP 表附後。
亞歷克斯.
自動化和腳本編寫資料混合與清理回覆:按行合併數據很常見的問題。
有很多技巧和解決方法。
在 JMP 的未來版本中,這將非常簡單:
:folded_hands: 摘要和製表:為字元列新增聚合選項
...如果有足夠的用戶點擊連結並投票。
回覆:按行合併數據這是一種方法
Names Default To Here(1);
dt = Current Data Table();
custom_sql = Eval Insert(
"\[SELECT Product, GROUP_CONCAT(DISTINCT CAST("Lot" as TEXT)) as "Lots in Product"
FROM t1
GROUP BY Product
]\");
dt_concat = Query(
Table(dt, "t1"),
custom_sql
);<BR /><BR />New window("Tablebox",<<TYPE></TYPE>Data Table Box( dt_concat ));回覆:按行合併數據另一個:
dt = Current Data Table();
dt << New Column( "rank", Formula( Col Rank( 1, :Product ) ), );
dtsplit = dt << Split(
Split By( :rank ),
Split( :Lot ),
Group( :Product ),
Remaining Columns( Drop All ),
);
cols = dt split << get column names();
cols = cols[2 :: N Items( cols )];
dt split << New Column( "concat", Character, Set Each value( Concat Items( cols, "," ) ) );
dt << Update(
With( dt split),
Match Columns( :Product = :Product ),
Add Columns from Update Table( :concat ),
Replace Columns in Main Table( None )
);
回覆:按行合併數據做工精美!謝謝你!