# Sort Report by Numeric Value

**URL:** <https://clarionhub.com/t/sort-report-by-numeric-value/6515>\
**Category:** questions\
**Tags:** report\
**Created:** [August 18, 2023, 7:34am UTC](https://clarionhub.com/t/sort-report-by-numeric-value/6515 "2023-08-18T07:34:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tonymarshall](https://clarionhub.com/user_avatar/clarionhub.com/tonymarshall/32/3786_2.png) [@Tonymarshall](https://clarionhub.com/u/Tonymarshall)\
**Post date:** [August 18, 2023, 7:34am UTC](https://clarionhub.com/t/sort-report-by-numeric-value/6515/1 "2023-08-18T07:34:31Z")

</div>

Hi

I created a report in Clarion 8 application and sorting the records by number.

Instead of order: `1,2,3,4,5,6,7,8,9,10`  
I get a return----\> `1,10,2 3 4 5 6 7 8 9`

Please can you help

Kind regards

---

<div class="post-metadata">

**Author:** ![Clarion\_clarion](https://clarionhub.com/user_avatar/clarionhub.com/clarion_clarion/32/636_2.png) [@Clarion\_clarion](https://clarionhub.com/u/Clarion_clarion)\
**Post date:** [August 18, 2023, 7:37am UTC](https://clarionhub.com/t/sort-report-by-numeric-value/6515/2 "2023-08-18T07:37:11Z")

</div>

It looks like you have a String field to store numbers so that’s why it sort like this.

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [August 18, 2023, 4:30pm UTC](https://clarionhub.com/t/sort-report-by-numeric-value/6515/3 "2023-08-18T16:30:53Z")

</div>

As @Clarion_clarion said your KEY field is probably a STRING? You could paste some of your file declaration to help us. Changing your File field to a LONG is one choice, or …

Reports use the VIEW engine. You could remove the KEY from the Report and set a specific PROP:Order. That supports Expressions like Evaluate() does. To turn your STRING into a Number include it in a Formula (w.g. 1+String) or use a Numeric function like INT() e.g.

```auto
Process:View{PROP:Order}='(1 + Pre:SomeStringField)' !Math with STRING results in Number
Process:View{PROP:Order}='INT(Pre:SomeStringField)' 

```

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/3/391a50300b0e25a1e2a31594e410f3202f273710.png)

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/2/26950db2079db95a4e1a4802803eb8bda5ecf9f8.png)
