How can I make a new column to count duplicates one by one without losing hte duplicated rows.
An example of the output I’m looking for is below
Order Number | Rank |
---|---|
5512 | 1 |
5512 | 2 |
5512 | 3 |
176 | 1 |
176 | 2 |
3098 | 1 |
831 | 1 |
831 | 2 |
How can I make a new column to count duplicates one by one without losing hte duplicated rows.
An example of the output I’m looking for is below
Order Number | Rank |
---|---|
5512 | 1 |
5512 | 2 |
5512 | 3 |
176 | 1 |
176 | 2 |
3098 | 1 |
831 | 1 |
831 | 2 |
Hi @Aliyaharu , and welcome to the KNIME community. The Ranking node can do this for you. For an example see this post:
You will need at least two columns in your original data table to work with the Ranking node. You will make the Order Number your “grouping attribute”. If you don’t have a second column to use as the “ranking attribute”, simple create a new column prior to calling the Ranking Node, eg you could use Counter Generation, and then use that column as the ranking attribute.
Thank you so much!! I was using much more complicated combinations of nodes and still not there, this is so direct and simple!