# Solved: \[Adding Rank Value Column\]

**URL:** <https://forum.knime.com/t/solved-adding-rank-value-column/6673>\
**Category:** KNIME Analytics Platform\
**Created:** [September 16, 2014, 3:18pm UTC](https://forum.knime.com/t/solved-adding-rank-value-column/6673 "2014-09-16T15:18:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaakko1](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/ecd19e/32.png) [@jaakko1](https://forum.knime.com/u/jaakko1)\
**Post date:** [September 16, 2014, 3:18pm UTC](https://forum.knime.com/t/solved-adding-rank-value-column/6673/1 "2014-09-16T15:18:02Z")

</div>

Hi all,

I'm trying to accomplish a task that seems simple, but can't seem to find a solution for it.

I have created a table with the data&nbsp;sorted from "best to worse". I would like to add a numerical column, so that the first row gets value '1', second row value '2', etc.

What's the best way to do this?&nbsp;

Thanks!

-J

---

<div class="post-metadata">

**Author:** ![swebb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/swebb/32/369_2.png) [@swebb](https://forum.knime.com/u/swebb)\
**Post date:** [September 16, 2014, 3:34pm UTC](https://forum.knime.com/t/solved-adding-rank-value-column/6673/2 "2014-09-16T15:34:30Z")

</div>

If you connect a String Manipulation node up and use "string($$ROWINDEX$$)" in the Expression and append column you should get a new column that gives the index of the row.&nbsp;

If you want it to start from 1 you should use "string($$ROWINDEX$$+ 1)"

Cheers

Sam

- [rowindex.png](https://www.knime.com/sites/default/files/rowindex.png)

---

<div class="post-metadata">

**Author:** ![richards99](https://forum-cdn.knime.com/user_avatar/forum.knime.com/richards99/32/48547_2.png) [@richards99](https://forum.knime.com/u/richards99)\
**Post date:** [September 16, 2014, 4:29pm UTC](https://forum.knime.com/t/solved-adding-rank-value-column/6673/3 "2014-09-16T16:29:44Z")

</div>

You can also use the Maths Formula node, with simply the ROWINDEX as the Maths Expression. Or ROWINDEX+1 if you want to start from 1 rather than 0.

&nbsp;

Simon.

---

<div class="post-metadata">

**Author:** ![Iris](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iris/32/14_2.png) [@Iris](https://forum.knime.com/u/Iris)\
**Post date:** [September 16, 2014, 5:18pm UTC](https://forum.knime.com/t/solved-adding-rank-value-column/6673/4 "2014-09-16T17:18:03Z")

</div>

Hi J,

the most simple way is the counter node.

Cheers, Iris

---

<div class="post-metadata">

**Author:** ![jaakko1](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/ecd19e/32.png) [@jaakko1](https://forum.knime.com/u/jaakko1)\
**Post date:** [September 16, 2014, 5:40pm UTC](https://forum.knime.com/t/solved-adding-rank-value-column/6673/5 "2014-09-16T17:40:27Z")

</div>

Thanks a lot for the replies! As Iris mentioned, the counter node does the trick the easiest way.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:23pm UTC](https://forum.knime.com/t/solved-adding-rank-value-column/6673/6 "2023-06-23T20:23:34Z")

</div>


