# How to get original row Index after sorting the Dataset

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-original-row-index-after-sorting-the-dataset/6496>\
**Category:** Ignition\
**Created:** [May 16, 2013, 6:37am UTC](https://forum.inductiveautomation.com/t/how-to-get-original-row-index-after-sorting-the-dataset/6496 "2013-05-16T06:37:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mreddy](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mreddy](https://forum.inductiveautomation.com/u/mreddy)\
**Post date:** [May 16, 2013, 6:37am UTC](https://forum.inductiveautomation.com/t/how-to-get-original-row-index-after-sorting-the-dataset/6496/1 "2013-05-16T06:37:19Z")

</div>

Folks,

Can you help me to get the original row index of the rows after sorting a Dataset. I will try to explain the exact scenario. we have a Dataset in table with group of some orders, when no columns are sorted the row index count from 0 to maximum, after sorting at-least one column the row indexes are sequenced as per new sorting like 2,5,0,6,1,7…etc. when i try to find the value at 0th row it is looking 3rd row as it had the Index as 0. Is there a way to get the sorted Index starting from zero? Please suggest.

Thanks,  
Moulee,  
Optebiz.

---

<div class="post-metadata">

**Author:** ![aidamcg](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aidamcg](https://forum.inductiveautomation.com/u/aidamcg)\
**Post date:** [May 16, 2013, 6:51am UTC](https://forum.inductiveautomation.com/t/how-to-get-original-row-index-after-sorting-the-dataset/6496/2 "2013-05-16T06:51:58Z")

</div>

Hi

I think the look up function will help you out. It is explained in the user manual under appendix B expressions/logic. I think you could use your index column in the dataset as the look up column.

Aidan

[http://www.inductiveautomation.com/support/usermanuals/ignition/](http://www.inductiveautomation.com/support/usermanuals/ignition/)

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [May 23, 2013, 9:22pm UTC](https://forum.inductiveautomation.com/t/how-to-get-original-row-index-after-sorting-the-dataset/6496/3 "2013-05-23T21:22:39Z")

</div>

I do not understand the question. Sorting a table by column is purely visual - it doesn’t alter the underlying dataset.
