# Previous row Number error when sorting number above 10

**URL:** <https://connect.superhuman.com/t/previous-row-number-error-when-sorting-number-above-10/44546>\
**Category:** Ask the Community\
**Created:** [November 17, 2023, 3:37pm UTC](https://connect.superhuman.com/t/previous-row-number-error-when-sorting-number-above-10/44546 "2023-11-17T15:37:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_Elrefae](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/mohamed_elrefae/32/30480_2.png) [@Mohamed\_Elrefae](https://connect.superhuman.com/u/Mohamed_Elrefae)\
**Post date:** [November 17, 2023, 3:37pm UTC](https://connect.superhuman.com/t/previous-row-number-error-when-sorting-number-above-10/44546/1 "2023-11-17T15:37:34Z")

</div>

i have built adoc which i use previous row to get my calculation from previous row  
i have column name items and columns name pay number  
i sort table by items and pay numbers  
formula works when pay number less than 10  
and get wrong sort when number more than 10  
formula  
thisTable.Filter(Items=thisRow.Items)

.Sort(false(),thisTable.[Pay No]) .

Filter((Concatenate(Items,[Pay No] )\<=  
Concatenate( thisRow.Items,thisRow.[Pay No]))  
&&[Row ID]!=thisRow.[Row ID] ).  
[Row ID].First()

screenshot

 ![previous row before number 10](https://global.discourse-cdn.com/coda1/original/3X/b/b/bb005e8aaf08955c7e7a33d7991e2c543ae15398.png)  
 ![previous row eroor for numder 10](https://global.discourse-cdn.com/coda1/original/3X/a/b/ab0c30e3a007d94272873da4ea592a36f0a8d65d.png)  
my doc  
https://coda.io/embed/l_JcqoWx6U?viewMode=embed  
my table  
https://coda.io/embed/l_JcqoWx6U?viewMode=embed

---

<div class="post-metadata">

**Author:** ![Christiaan\_Huizer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/christiaan_huizer/32/28269_2.png) [@Christiaan\_Huizer](https://connect.superhuman.com/u/Christiaan_Huizer)\
**Post date:** [November 17, 2023, 9:09pm UTC](https://connect.superhuman.com/t/previous-row-number-error-when-sorting-number-above-10/44546/2 "2023-11-17T21:09:06Z")

</div>

hi @Mohamed_Elrefae ,  
you may benefit from this blog, it shows how to use filters to get a preceding value. it also references blogs discussing other approaches.

> **[Preceding values in Coda](https://huizer.medium.com/preceding-values-in-coda-a5cd643aaae0)**
>
> Why date time data is essential in your set up

I hope it helps, cheers, christiaan

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [February 15, 2024, 9:09pm UTC](https://connect.superhuman.com/t/previous-row-number-error-when-sorting-number-above-10/44546/3 "2024-02-15T21:09:39Z")

</div>

Closed on February 15, 2024, 9:09pm UTC

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