Add repeated values in a new column for duplicated rows

Hello all,

I need some support in the creation of a new column with repeated values.

I have the next table (column):

A
A
A
B
B
B
.
.
.
Z
Z
Z

I want to add a new column with repeated values as in the next table:

|A|1|
|A|2|
|A|3|
|B|1|
|B|2|
|B|3|
|.|.|
|.|.|
|.|.|
|Z|1|
|Z|2|
|Z|3|

I would be very grateful for a useful help!

Best Regards,
Roland

Hi @rolandnemeth

and welcome to KNIME forum. One way to do this is to use a Group Loop with a Counter Generator inside the loop. See this rank_within_group.knwf (20.9 KB)
Screenshot from 2020-11-10 20-28-56
gr. Hans

2 Likes

Hello @HansS

many thanks for the fast reaction, it solved my problem.

Regards,
Roland

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.