# Sorting by multiple values

**URL:** <https://connect.superhuman.com/t/sorting-by-multiple-values/10511>\
**Category:** Ask the Community\
**Created:** [September 11, 2019, 4:23pm UTC](https://connect.superhuman.com/t/sorting-by-multiple-values/10511 "2019-09-11T16:23:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Filmos](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/filmos/32/9322_2.png) [@Filmos](https://connect.superhuman.com/u/Filmos)\
**Post date:** [September 12, 2019, 7:29am UTC](https://connect.superhuman.com/t/sorting-by-multiple-values/10511/5 "2019-09-12T07:29:12Z")

</div>

Thanks to @Bobby_Ritter help, I was able to came up with a pretty good solution.

I’m converting the number values from base 10 to base 20000, which allows me to store integers up to 1.6e17, or numbers up to 1.6e13 with 0.0001 precision.  
Then I’m converting those numbers into unicode symbols [from 20000 to 40000](https://unicode-table.com/en/blocks/cjk-unified-ideographs/) and into a string.  
This way the entries can be sorted by the lexicographical order of the strings.

This solution only relies on turning the numbers into a string, which is just a bunch of mathematical operations so it doesn’t require a lot of computing power.  
I also did some actual performance testing, and everything works perfectly and very fast.

The final formula looks like this:

```auto
List(
  thisRow.[First number],
  thisRow.[Second number]
).FormulaMap(
   Character(Floor(CurrentValue/800000000)+20000)+
   Character(Floor(CurrentValue/40000%20000)+20000)+
   Character(Floor(CurrentValue/2%20000)+20000)+
   Character(Floor(CurrentValue*10000%20000)+20000)
).Join(" ")

```

And produces following results:  
 ![image](https://global.discourse-cdn.com/coda1/original/2X/e/e2a0fde43239b4de7f7680bba774a3e8fe2850b3.png)

---

_[View the full topic](https://connect.superhuman.com/t/sorting-by-multiple-values/10511)._
