This is my error. In my rush, I indicated the wrong place for the trailing "num". Here is a little script that creates your Entity column and then add the new column with the counter in it.
Names Default To Here( 1 );
dt = New Table( "count",
Add Rows( 34 ),
New Column( "Entity",
Character,
"Nominal",
Set Values(
{"RLC101", "RLC101", "RLC101", "RLC101", "RLC102", "RLC102", "RLC102", "RLC102", "RLC102",
"RLC102", "RLC102", "RLC102", "RLC102", "RLC102", "RLC102", "RLC102", "RLC103", "RLC103", "RLC103",
"RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC104",
"RLC104", "RLC104", "RLC104", "RLC104", "RLC101"}
)
)
);
dt << New Column( "Number",
numeric,
formula( If( Lag( :ENTITY ) != :ENTITY, num = 1, num = num + 1 );
num;
));
Jim