Crear un Row Number en Knime

Hola a todos, una colaboracion… necesito crear un row numbes en Knime que me adicione una columna a una tabla con una serie de numeros dependiendo de otra columna … ejemplo.
image

saben como lo puedo lograr?

gracias de antemano.

Hi @hamapa05 , please provide input data in the future so we know what’s input and what’s output.

I am guessing that the input data is as follows?
image

Here’s a workflow I put together: Create Row Number based on another column.knwf (14.7 KB)

It produces this result:
image

2 Likes

I have borrowed @bruno29a’s idea, and included an alternative using the Rank node.

I think both solutions work and do the same job, as long as Col 1 is always repeating all of the values. It seems to work :wink:
Create Row Number based on another column - using Rank.knwf (18.2 KB)

Edit: I just realised that if you tick “Retain Row Order”, the Rank node does the entire job without having to join back…

image

2 Likes

Nice @takbb , I like this alternative

1 Like

Excelente, voy a probarlo!

Muchas gracias, voy a probarlo.

1 Like

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