Insert Serial Number Column

Dear All,
Good day to All.

May I request a way to insert the serial number column in my data.
Which node and how can I use it?

Thanks All.

Hi @Charm_Myae,

what do you mean under serial number column exactly?

Roland

2 Likes

Hi,

I’ll take a guess and suggest the Constant Value Column Node? It appends a column with a fixed value or allows to use a flow variable to change the value dynamically.

Let us know if you need something else. :slight_smile:

Happy New Year, T

1 Like

Thank you very much @Thyme.

Hi @rolandnemeth,
I mean that, in my data table, originally did not include serial number column, I want to add Serial No. Column 1, 2, 3, …

Not only one file, but they are also monthly continuous data files. I also consider preparing in Excel before importing to KNIME, but it is not OK.

Like Power Query => Add Column => Index Column (from 1).

Thanks.

I got some ideas from @Thyme.

hi @Charm_Myae,

If you would like to implement the row counter with sorting, I suggest the Rank node.

If you would like to simply add the row count for each row, I propose the Counter generation node. This is the same as the Power Query function, what you mentioned, you can set up the start value and the scaling in the node settings.

Please have a look at the attached workflow.

Best Regards,
Roland

Row_Counter.knar.knwf (8.0 KB)

7 Likes

Hi @rolandnemeth,

Thank you very much for your suggestion.
I got the solution with your suggestion “Counter Generation Node”.

1 Like

@Charm_Myae you are welcome!

1 Like

Hi @Charm_Myae ,

Please see the workflow in KNIME Hub. More simple and straight forward.

Thanks!

2 Likes

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