# Sort Table to find Latest nbr based on a date

**URL:** <https://community.glideapps.com/t/sort-table-to-find-latest-nbr-based-on-a-date/74028>\
**Category:** Ask for Help\
**Created:** [June 10, 2024, 4:03pm UTC](https://community.glideapps.com/t/sort-table-to-find-latest-nbr-based-on-a-date/74028 "2024-06-10T16:03:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AxelG](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@AxelG](https://community.glideapps.com/u/AxelG)\
**Post date:** [June 10, 2024, 4:03pm UTC](https://community.glideapps.com/t/sort-table-to-find-latest-nbr-based-on-a-date/74028/1 "2024-06-10T16:03:30Z")

</div>

I have a table (Eg.: Table A) with which basically consists of NAME / DATE / WEIGHT / …

other table (Eg.: Table B) does a relation where it basicalle matches the NAME (based on ID, not important here as this is working fine)

Based on that relation I also introduced a Lookup Column who get the WEIGHTS for that NAME. There can be Multiple results. Then I have a Single Value Column which only shows the last value of the WIEGHTS .

There is my issue.It returns idd the latest value, but I wanted this to be based on the Sorted dates in Table A. (These are in a random order. and I want to have the most current weight )  
How can I introduce that sort on the Lookup Weights Lookup Column ?

---

<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:** [June 10, 2024, 4:16pm UTC](https://community.glideapps.com/t/sort-table-to-find-latest-nbr-based-on-a-date/74028/2 "2024-06-10T16:16:34Z")

</div>

Use a Query column instead of a relation and set the sorting accordingly. Then use a Single Value column to get the last record in the query. You don’t need the Lookup column.

---

<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 17, 2024, 4:17pm UTC](https://community.glideapps.com/t/sort-table-to-find-latest-nbr-based-on-a-date/74028/3 "2024-06-17T16:17:36Z")

</div>

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