# Sort number

**URL:** https://community.glideapps.com/t/sort-number/62289
**Category:** Ask for Help
**Created:** [May 30, 2023, 3:33pm UTC](https://community.glideapps.com/t/sort-number/62289 "2023-05-30T15:33:53Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![agung\_Taufik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik/32/2589_2.png) [@agung\_Taufik](https://community.glideapps.com/u/agung_Taufik)
#### Post date: [May 30, 2023, 3:33pm UTC](https://community.glideapps.com/t/sort-number/62289/1 "2023-05-30T15:33:54Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/b/fbdf2c2e9594373d60beb31f8a608c0f45a8769b.png)  
Hi…  
how to sort numbers from smallest to largest based on **HARGA JUAL**  
in Ghseet I use the **RANK** formula,

---

<div class="post-metadata">

### Author: ![MatthewS](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/matthews/32/40533_2.png) [@MatthewS](https://community.glideapps.com/u/MatthewS)
#### Post date: [May 30, 2023, 3:40pm UTC](https://community.glideapps.com/t/sort-number/62289/2 "2023-05-30T15:40:47Z")

</div>

As far as I’m aware, in Glide tables you never sort your rows. That’s done when displaying. You’ll see in collection components (eg list) you can sort the view by sheet order or by a column value.

Does that satisfy your need, to sort your list viewed in app?

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [May 30, 2023, 3:50pm UTC](https://community.glideapps.com/t/sort-number/62289/3 "2023-05-30T15:50:06Z")

</div>

If you do actually need to rank the data, then the new Query column will help you with that.

> **[Glide • Query Column](https://www.glideapps.com/docs/reference/computed-columns/query-column)**
>
> Create complex relations in your data with conditional filtering, sorting and limits.

---

<div class="post-metadata">

### Author: ![agung\_Taufik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik/32/2589_2.png) [@agung\_Taufik](https://community.glideapps.com/u/agung_Taufik)
#### Post date: [May 30, 2023, 5:02pm UTC](https://community.glideapps.com/t/sort-number/62289/4 "2023-05-30T17:02:30Z")

</div>

Thanks @Darren_Murphy  
I’ve created a query column, next I want to create a dynamic label that determines the winning number, is there a way to do that?  
I want to sort selling price from smallest to biggest, I want to use that for the title component

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/8/5831b94717cce00bf862400d530ae2fb965c8ffa.png)

---

<div class="post-metadata">

### Author: ![agung\_Taufik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik/32/2589_2.png) [@agung\_Taufik](https://community.glideapps.com/u/agung_Taufik)
#### Post date: [May 30, 2023, 5:02pm UTC](https://community.glideapps.com/t/sort-number/62289/5 "2023-05-30T17:02:54Z")

</div>

Thanks @MatthewS

---

<div class="post-metadata">

### Author: ![agung\_Taufik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik/32/2589_2.png) [@agung\_Taufik](https://community.glideapps.com/u/agung_Taufik)
#### Post date: [May 30, 2023, 6:15pm UTC](https://community.glideapps.com/t/sort-number/62289/6 "2023-05-30T18:15:48Z")

</div>

is there a way for this?

> [@agung\_Taufik](#):
>
> I’ve created a query column, next I want to create a dynamic label that determines the winning number, is there a way to do that?  
> I want to sort selling price from smallest to biggest, I want to use that for the title component

is there a way for this?

---

<div class="post-metadata">

### Author: ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)
#### Post date: [May 30, 2023, 6:18pm UTC](https://community.glideapps.com/t/sort-number/62289/7 "2023-05-30T18:18:04Z")

</div>

Hola,

If I were you, I’d do it this way:

1. Lookup the Price column to get a Price array  

2. using the _Sort Array_ plugin, sort Price[] column  

3. then, use _Find Element Index_ plugin to build your ranking looking for each price in Price[] column  

That’s all! 💪

Saludos!

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [May 30, 2023, 11:47pm UTC](https://community.glideapps.com/t/sort-number/62289/8 "2023-05-30T23:47:47Z")

</div>

Here’s an alternative with Query.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/6/362e838f1818e3203945421edbb6d6ffaa72a71b.png)

Use a query to sort based on the price.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/3/138dcb5ac4d47b72b894ffeb523b2404e1449bbb.png)

Use a lookup to return the list of rowIDs based on the query.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/f/0f2d18546c6cfd50806bc5717ebae041dbdd4a0e.jpeg)

Use “find element index” to return the index of the row.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/7/17196c89be97689605aeb54ae7940a61ea10dee6.jpeg)

Use a math column to return the final rank (index + 1, since index starts from 0)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/5/85bfb8b5a90692c2ab9b370b1f57653a494856be.png)

---

<div class="post-metadata">

### Author: ![agung\_Taufik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik/32/2589_2.png) [@agung\_Taufik](https://community.glideapps.com/u/agung_Taufik)
#### Post date: [May 31, 2023, 1:38pm UTC](https://community.glideapps.com/t/sort-number/62289/9 "2023-05-31T13:38:20Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/d/cdda975e1ff7971558417c139ec2b510e71edf43.jpeg)

hi thin thanks for the response.  
what if the case is like this:  
Arisan group column  
**KELOMPOK 1** has 5 different prices and has a rank from 1 to 5  
**KELOMPOK 2** has 7 different prices and has a rank from 1 to 7

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [May 31, 2023, 11:26pm UTC](https://community.glideapps.com/t/sort-number/62289/10 "2023-05-31T23:26:00Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/5/557f5801b5b8e88b4aa8ccc0923522837c7fd272.png)

Adjust your query so that “Kelompok arisan” equals to this row \> “Kelompok arisan”. Then everything else should follow.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/6/1670b83b328426d7df1d6eb4a60b978de4b697c4.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/1/01266e494f861380cc4f69319a325a4b0b01d8ae.png)

---

<div class="post-metadata">

### Author: ![agung\_Taufik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik/32/2589_2.png) [@agung\_Taufik](https://community.glideapps.com/u/agung_Taufik)
#### Post date: [June 1, 2023, 12:29am UTC](https://community.glideapps.com/t/sort-number/62289/11 "2023-06-01T00:29:09Z")

</div>

Wow amazing  
thank you very much @ThinhDinh , this method works  
and thank you very much for your help… @Darren_Murphy @gvalero  
@matthews

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [June 2, 2023, 12:29am UTC](https://community.glideapps.com/t/sort-number/62289/12 "2023-06-02T00:29:30Z")

</div>

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