# Can I retrieve a value in a relation based on a sort?

**URL:** <https://community.glideapps.com/t/can-i-retrieve-a-value-in-a-relation-based-on-a-sort/27111>\
**Category:** Ask for Help\
**Created:** [May 22, 2021, 7:31pm UTC](https://community.glideapps.com/t/can-i-retrieve-a-value-in-a-relation-based-on-a-sort/27111 "2021-05-22T19:31:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daspearce](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daspearce/32/26707_2.png) [@daspearce](https://community.glideapps.com/u/daspearce)\
**Post date:** [May 22, 2021, 7:31pm UTC](https://community.glideapps.com/t/can-i-retrieve-a-value-in-a-relation-based-on-a-sort/27111/1 "2021-05-22T19:31:02Z")

</div>

Hi,

Is it possible to do a lookup or find a record value based on a sort in a sub table.

Table A: Companies, idCompanies

Table B: fk\_idCompanies, date of investment, valuation.

I want to show the latest valuation in my company record view. I am already showing a list, so want to create a lookup or calculation based on the last record by date of investment in my sub table.

? Is this possible?

---

<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 22, 2021, 11:29pm UTC](https://community.glideapps.com/t/can-i-retrieve-a-value-in-a-relation-based-on-a-sort/27111/2 "2021-05-22T23:29:11Z")

</div>

On top of the relation, you can use a single value column to retrieve the last value of a column found through that relation.

---

<div class="post-metadata">

**Author:** ![daspearce](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daspearce/32/26707_2.png) [@daspearce](https://community.glideapps.com/u/daspearce)\
**Post date:** [May 23, 2021, 9:58am UTC](https://community.glideapps.com/t/can-i-retrieve-a-value-in-a-relation-based-on-a-sort/27111/3 "2021-05-23T09:58:47Z")

</div>

Star!! Thanks

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:52pm UTC](https://community.glideapps.com/t/can-i-retrieve-a-value-in-a-relation-based-on-a-sort/27111/4 "2024-01-17T16:52:05Z")

</div>


