# Is it possible to use 'Group by' with 'List Collection' and order the groups in alphabetical order while ordering the lists by date?

**URL:** https://community.glideapps.com/t/is-it-possible-to-use-group-by-with-list-collection-and-order-the-groups-in-alphabetical-order-while-ordering-the-lists-by-date/77548
**Category:** Ask for Help
**Created:** [November 1, 2024, 11:59am UTC](https://community.glideapps.com/t/is-it-possible-to-use-group-by-with-list-collection-and-order-the-groups-in-alphabetical-order-while-ordering-the-lists-by-date/77548 "2024-11-01T11:59:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Rafael\_Salla\_Paulilo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rafael_salla_paulilo/32/71453_2.png) [@Rafael\_Salla\_Paulilo](https://community.glideapps.com/u/Rafael_Salla_Paulilo)
#### Post date: [November 1, 2024, 11:59am UTC](https://community.glideapps.com/t/is-it-possible-to-use-group-by-with-list-collection-and-order-the-groups-in-alphabetical-order-while-ordering-the-lists-by-date/77548/1 "2024-11-01T11:59:02Z")

</div>

Is it possible to use ‘Group by’ with ‘List Collection’ and order the groups in alphabetical order while ordering the lists by date?

 ![Captura de Tela 2024-11-01 às 08.58.42](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/0/209e4908a700f742cd63a45bdeb1f9c312b51f83.jpeg)

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 1, 2024, 2:11pm UTC](https://community.glideapps.com/t/is-it-possible-to-use-group-by-with-list-collection-and-order-the-groups-in-alphabetical-order-while-ordering-the-lists-by-date/77548/2 "2024-11-01T14:11:43Z")

</div>

Try creating a query column that first sorts by date. Set the source of the collection to be the query. Then sort the collection by group. I know this hasn’t worked in some cases, but it might with a List collection.

---

<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: [November 1, 2024, 3:48pm UTC](https://community.glideapps.com/t/is-it-possible-to-use-group-by-with-list-collection-and-order-the-groups-in-alphabetical-order-while-ordering-the-lists-by-date/77548/3 "2024-11-01T15:48:33Z")

</div>

An alternative is getting the numeric version of the first character in each group, then use it in a math formula in tandem with the date to get a final number to sort. Something like:

`Group Num*10^5 + YEAR(D)*10^4 + MONTH(D)*10^2 + DAY(D)`

---

<div class="post-metadata">

### Author: ![Rafael\_Salla\_Paulilo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rafael_salla_paulilo/32/71453_2.png) [@Rafael\_Salla\_Paulilo](https://community.glideapps.com/u/Rafael_Salla_Paulilo)
#### Post date: [November 1, 2024, 5:47pm UTC](https://community.glideapps.com/t/is-it-possible-to-use-group-by-with-list-collection-and-order-the-groups-in-alphabetical-order-while-ordering-the-lists-by-date/77548/4 "2024-11-01T17:47:29Z")

</div>

Thanks, @ThinhDinh! Very smart solution!

---

<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: [November 8, 2024, 5:48pm UTC](https://community.glideapps.com/t/is-it-possible-to-use-group-by-with-list-collection-and-order-the-groups-in-alphabetical-order-while-ordering-the-lists-by-date/77548/5 "2024-11-08T17:48:09Z")

</div>

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