Colmax() has a by variable you can give to it. I thik this does what you want. You can even give multiple by columns if you want.
Names default to here(1);
dt = New Table( "Untitled 101",
Add Rows( 10 ),
New Column( "ID",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 1, 2, 2, 3, 3, 3, 3, 1, 1] ),
Set Display Width( 51 )
),
New Column( "Datetime",
Numeric,
"Continuous",
Format( "m/d/y h:m:s", 23, 0 ),
Input Format( "m/d/y h:m:s", 0 ),
Set Selected,
Set Values(
[3758218580, 3758222180, 3758225780, 3758229380, 3758232980, 3758236580,
3758240180, 3758243780, 3758247380, 3758250980]
)
),
);
dt << New COlumn("Max by ID",
Format( "m/d/y h:m:s", 23, 0 ),
Formula(Colmax(:Datetime, :ID))
)