Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
within an expression I need to autonumerate rows in a way that new Name restarts counter
Name, Number
John, 1
John, 2
Mary, 1
John, 3
Mary, 2
Any idea?
Regards,
Przemek
Hi,
use the example code below
Temp1:
LOAD * INLINE [
name
John
John
Mary
John
Mary
];
Regards
Przemek
Tab:
NoConcatenate
LOAD
name,
IF (peek('name')<>name,1, peek('counter')+1) AS counter
RESIDENT Temp1
order by name;
drop table Temp1;
Hi Przemek 🙂
thanks for the reply. The problem, however, is that I need to have it built within an expression not script.
Regards,
Przemek
You could use similar approach, however that would only work when the names are sorted.
I can't think of a possible workaround at the moment (without having the names sorted).
Regards
Przemek