# How to use a second filter

**URL:** https://community.glideapps.com/t/how-to-use-a-second-filter/73390
**Category:** Ask for Help
**Created:** [May 15, 2024, 7:32am UTC](https://community.glideapps.com/t/how-to-use-a-second-filter/73390 "2024-05-15T07:32:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Pavel\_P](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pavel\_P](https://community.glideapps.com/u/Pavel_P)
#### Post date: [May 15, 2024, 7:32am UTC](https://community.glideapps.com/t/how-to-use-a-second-filter/73390/1 "2024-05-15T07:32:54Z")

</div>

Hi,  
Please help me with advice.  
I have three tables:

1. Purchases
2. Categories (products, fuel, etc)
3. Buyers

One purchase can only have one category and one buyer. One category can have many purchases. One buyer can have many purchases.  
The Category table is connected to the Purchases table via Relation (by category row id). The Buyers table is connected to the Purchases table via Relation (by buyer row id).  
My purpose is to add in each row of the Buyers table the sum of his purchases in a certain category.  
Now I know how to add the sum of all purchases of a certain buyer (via Rollup).  
But how to use a second filter? How to add the sum of purchases of a certain buyer in a certain category?  
Thank you for advices!

---

<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: [May 15, 2024, 11:28am UTC](https://community.glideapps.com/t/how-to-use-a-second-filter/73390/2 "2024-05-15T11:28:57Z")

</div>

If you need a second filter, use a Query instead of a Relation.

> **[Query Column | Glide Docs](https://www.glideapps.com/docs/automation/computed-columns/query-column)**
>
> Create complex relations in your data with conditional filtering, sorting, and limits.

---

<div class="post-metadata">

### Author: ![Pavel\_P](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pavel\_P](https://community.glideapps.com/u/Pavel_P)
#### Post date: [May 15, 2024, 1:56pm UTC](https://community.glideapps.com/t/how-to-use-a-second-filter/73390/3 "2024-05-15T13:56:42Z")

</div>

Works really well. Thanks a lot @Jeff_Hager

---

<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 22, 2024, 1:57pm UTC](https://community.glideapps.com/t/how-to-use-a-second-filter/73390/4 "2024-05-22T13:57:12Z")

</div>

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