# Sorting list by sublists

**URL:** <https://forum.dynamobim.com/t/sorting-list-by-sublists/31150>\
**Category:** Revit\
**Created:** [January 24, 2019, 8:57am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150 "2019-01-24T08:57:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkykiki](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kkykiki](https://forum.dynamobim.com/u/kkykiki)\
**Post date:** [January 24, 2019, 8:57am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/1 "2019-01-24T08:57:52Z")

</div>

I

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/6/e681c49bf81e5ba453a33c06e32ff201d2e65533.jpeg) found the way how to sort the x point of element in ascending order.  
but I wonder how to sort the y point in descending in order while maintaining in x point ascending order…  
Sorry for my english…

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [January 24, 2019, 9:18am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/2 "2019-01-24T09:18:55Z")

</div>

Try doing the sorting in the opposite order of what you want. For example, if you want:

1. sorted in ascending order by index 1 of the sublist, and then
2. sorted in descending order by index 2

you should do the opposite order, meaning:

1. sort by descending order by index 2, then
2. sort by ascending order by index 1.

See attached:

 ![sortthensort](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/d/8dd43db0de9cf26441a5749d964c7d2f659475cb.png)

---

<div class="post-metadata">

**Author:** ![kkykiki](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kkykiki](https://forum.dynamobim.com/u/kkykiki)\
**Post date:** [January 24, 2019, 12:08pm UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/3 "2019-01-24T12:08:42Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/d/9d49b802f5c86294416efd4e0d1d9fa1c0d23598.jpeg)

---

<div class="post-metadata">

**Author:** ![kkykiki](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kkykiki](https://forum.dynamobim.com/u/kkykiki)\
**Post date:** [January 25, 2019, 1:41am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/4 "2019-01-25T01:41:35Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/b/4bb732c07cfb1e5f1a6bfa3a48d449edc2fb008c.jpeg) Same result… T.T

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [January 25, 2019, 1:45am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/5 "2019-01-25T01:45:11Z")

</div>

It looks like it worked, but the Dynamo data is missing some of the data that the excel has. For example, Excel’s row 3 doesn’t look like it exists in the dynamo data.

But for what is in Dynamo, it is sorted first by ascending column D, then by descending column E so it looks like it worked. Can you show where it doesn’t?

---

<div class="post-metadata">

**Author:** ![kkykiki](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kkykiki](https://forum.dynamobim.com/u/kkykiki)\
**Post date:** [January 25, 2019, 2:04am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/6 "2019-01-25T02:04:53Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/7/07fbab29924db456992b5a0460aedb8a124b6c5b.jpeg) sort by descending order is reset in Row 37…

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [January 25, 2019, 2:06am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/7 "2019-01-25T02:06:38Z")

</div>

Check the data in row D to make sure that there aren’t more places after the decimal you can’t see. It might be ordering to a higher significant digit that you can’t see.

---

<div class="post-metadata">

**Author:** ![kkykiki](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kkykiki](https://forum.dynamobim.com/u/kkykiki)\
**Post date:** [January 25, 2019, 2:13am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/8 "2019-01-25T02:13:06Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/1/112e62dfb1865dbca6de45b028ded123d5411b8a.jpeg)  
I checked… It’s same

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [January 25, 2019, 2:14am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/9 "2019-01-25T02:14:17Z")

</div>

Try with an == or \> node. It shouldn’t be able to just reset the sorting after a random amount of items.

---

<div class="post-metadata">

**Author:** ![kkykiki](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kkykiki](https://forum.dynamobim.com/u/kkykiki)\
**Post date:** [January 25, 2019, 2:15am UTC](https://forum.dynamobim.com/t/sorting-list-by-sublists/31150/10 "2019-01-25T02:15:25Z")

</div>

Ok. I’ll try. Thanks!
