# Multiple Relations - Filter Latest Match

**URL:** <https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010>\
**Category:** Ask for Help\
**Created:** [May 22, 2023, 2:25pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010 "2023-05-22T14:25:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curtis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/curtis/32/59826_2.png) [@Curtis](https://community.glideapps.com/u/Curtis)\
**Post date:** [May 22, 2023, 2:25pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/1 "2023-05-22T14:25:31Z")

</div>

We have a pricing app with two tables. The first table is a list of the products and the second table is a list of the costs for each product.  
We are constantly updating the costs table with new pricing. I am using a relation column to link the products to the costs. But it seems to be linking to the first quote rather than the latest one. When there are multiple relations how can I filter to show only the most recent one?

---

<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 22, 2023, 2:34pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/2 "2023-05-22T14:34:22Z")

</div>

If you make the relation a multiple relation, you can then use Single Value → Last to fetch the last one added.

---

<div class="post-metadata">

**Author:** ![Curtis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/curtis/32/59826_2.png) [@Curtis](https://community.glideapps.com/u/Curtis)\
**Post date:** [May 22, 2023, 2:47pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/3 "2023-05-22T14:47:51Z")

</div>

This works well but if old quotes are added for historic pricing it will show those as they are the last added.  
Is there an option to show the most “recent” by a date field rather than last added?

---

<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 22, 2023, 2:49pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/4 "2023-05-22T14:49:18Z")

</div>

Yes, you could use the new Query column to order the relation by date. You could limit it to return just a single result, although it will return an array so you would still need the single value column.

---

<div class="post-metadata">

**Author:** ![Curtis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/curtis/32/59826_2.png) [@Curtis](https://community.glideapps.com/u/Curtis)\
**Post date:** [May 22, 2023, 2:57pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/5 "2023-05-22T14:57:11Z")

</div>

Thanks Darren,  
I’m struggling to find the Query Column.  
Is it an Array \> Unique Elements or using the OpenAi integration?

---

<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 22, 2023, 3:01pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/6 "2023-05-22T15:01:27Z")

</div>

You need to enable it. Go to your main Glide dashboard, and you’ll see a “Previews” section at the top right. You can enable it there.

---

<div class="post-metadata">

**Author:** ![Curtis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/curtis/32/59826_2.png) [@Curtis](https://community.glideapps.com/u/Curtis)\
**Post date:** [May 22, 2023, 3:38pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/7 "2023-05-22T15:38:18Z")

</div>

Thank you, that works great

---

<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:** [May 23, 2023, 3:39pm UTC](https://community.glideapps.com/t/multiple-relations-filter-latest-match/62010/8 "2023-05-23T15:39:15Z")

</div>

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