Here are a couple of ways to create the column you want
txnelson_0-1638965213803.png
Names Default To Here( 1 );
dt = New Table( "custIDs",
New Column( "Customer_ID", character, values( {"c1", "c1", "c1", "c2", "c2", "c3", "c3", "c3"} ) )
);
dt << New Column( "Or like this" );
counter = 0;
For( i = 1, i <= N Rows( dt ), i++,
If(
i == N Rows( dt ),
counter++;
:or like this[i] = counter;,
:Customer_ID[i] != :Customer_ID[i + 1],
counter++;
:or like this[i] = counter;
)
);
// or
dt << New Column( "or like this using formula",
formula(
x = .;
If( Row() == 1, counter = 0 );
If( :Customer_ID != Lag( :Customer_ID, -1 ) | Row() == N Rows( Current Data Table() ),
counter++;
x = counter;
);
x;
)
);
Jim