Sorting an Array

Hi everyone

I try get the 3 highest numbers so I sort an array by the value but two digit numbers appear higher in the sorted list then three digit numbers.

In the first pic you can see the row numbers and the value in row 5.

In the second pic you can see that the value 81 for example is listed above the value 528 in the sorted list.

Does anyone know what the problem is?


@Jan

The issue is that what you are seeing LOOKS like numbers, but it is stored and treated as text.

You will need to convert them to number values or add leading zeros.


Jim - The Monday Man (YouTube Channel) Our latest vid: Reading REALLY Large monday Boards
What is Make & How can it help you with monday?
We Create Custom Solutions - Your Make or Ours
Schedule a 1-on-1 Tutorial Session (for monday, Make or ā€œRocket Scienceā€)

1 Like

Hey Jim

Thanks for your answer. How can I convert the values to number values?

I added a screenshot of my scenario. Iā€™m getting the values from google sheet, make an array an d sort it.

I added a leading 0 in google sheets and that doesnā€™t work. I also have some negativ values and with the ā€˜0ā€™ added in front they look like this for example ā€˜0-22ā€™

@Jan

The easiest way is to change the value render option to ā€œUnformatted valueā€

3 Likes

nice. thanks a lot jim

3 Likes

@Jan

Youā€™re wlecome.


Jim - The Monday Man (YouTube Channel) Our latest vid: Reading REALLY Large monday Boards
What is Make & How can it help you with monday?
We Create Custom Solutions - Your Make or Ours
Schedule a 1-on-1 Tutorial Session (for monday, Make or ā€œRocket Scienceā€)

1 Like