here is another way of getting it done.
this way creates a table summary and gives a number to each unique value. by default this is done in ascending order but could be descending or any other order you wish.
the current formula of numbering can also be more sophisticated for different units or increments as desired.
all steps can also be done by clicking buttons in the menus
let us know if it works.
// create data table to work with
dt1 = New Table( "Untitled", Add Rows( 11 ),
New Column( "Column 1", Character, "Nominal",
Set Values({"aaa", "bb", "ccc", "aaa", "ddd", "eee", "ccc", "bb", "bb", "ccc", "aaa"})
)
);
// start working
// Data table summary
dt2 = dt1 << Summary( Group( :Column 1 ), Freq( "None" ), Weight( "None" ), Link to original data table( 0 ));
// Delete column: N Rows
dt2 << Delete Columns( :N Rows );
// New column: result
dt2 << New Column( "result", Numeric, "Continuous", Format( "Best", 12 ),Formula( Row() ));
// Delete column formula: result
dt2:result << Delete Formula;
// Update data tables
dt1 << Update(
With( Data Table( dt2 ) ),
Match Columns( :Column 1 = :Column 1 ),
Replace Columns in Main Table( None )
);
// Close Data Table: Untitled By (Column 1)
Close( dt2, no save );