我有一個包含 A 列(字符)的表。 我想在數值中添加一個新列,表示 A 列的分組。 如何自動執行此操作? A 列有太多字符,我無法手動對它們進行分組。
可能可以使用 Cols --> Utilities --> Labels to Code (它會自動分配基於字母順序的代碼)?

然後使用以下公式創建新列;
:新列 << 設置公式( Col 存儲值( :Column A ) );
還有一個問題是代碼是按順序給出的。 我想知道是否有一種方法可以根據 A 列中出現次數最多的次數來分配數字。
要根據 A 列中最高出現次數分配數字,需要一些解決方法。
1. 按組創建匯總表,“A 列”--> 對 N 列“降序”排序
2.添加公式列:new result = Row();
3. 連接兩個表或更新主表以匹配“A 列”。

如果您使用腳本,則需要如下幾行;
// → Data Table( "Untitled" )
New Table( "Untitled" );
// Data table summary
// → Data Table( "Untitled By (Column A)" )
Data Table( "Untitled" ) << Summary(
Group( :Column A ),
Freq( "None" ),
Weight( "None" )
);
// Sort data table
Data Table( "Untitled By (Column A)" ) << Sort(
By( :N Rows ),
Replace Table,
Order( Descending )
);
// New column: new result
Data Table( "Untitled By (Column A)" ) << New Column( "new result",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Row() )
);
// Update data tables
Data Table( "Untitled" ) << Update(
With( Data Table( "Untitled By (Column A)" ) ),
Match Columns( :Column A = :Column A )
);希望能幫助到你。