# How to filter user-specific data by category from another table

**URL:** https://community.glideapps.com/t/how-to-filter-user-specific-data-by-category-from-another-table/36053
**Category:** Ask for Help
**Created:** [December 17, 2021, 1:52pm UTC](https://community.glideapps.com/t/how-to-filter-user-specific-data-by-category-from-another-table/36053 "2021-12-17T13:52:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Martina\_G](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martina_g/32/22597_2.png) [@Martina\_G](https://community.glideapps.com/u/Martina_G)
#### Post date: [December 17, 2021, 1:52pm UTC](https://community.glideapps.com/t/how-to-filter-user-specific-data-by-category-from-another-table/36053/1 "2021-12-17T13:52:20Z")

</div>

Hey guys,

I want to trigger some calculations from a specific spendings table in the user table.

Table for tracking spendings:

- each entry per spending per user
- category filter

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/4/d4b4fefd15f74e93bb2ba10f2d17cd1da9bb171b.png)

In the user table:

- counting all entries already works, also calculation for total amount  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/b/1bfeb30d75a2b42824daddf4a6c34074ce3f14da.png)

How can I count for each user number of entries and total amount by CATEGORY?

Kind regards,  
Martina

---

<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: [December 18, 2021, 12:14am UTC](https://community.glideapps.com/t/how-to-filter-user-specific-data-by-category-from-another-table/36053/3 "2021-12-18T00:14:41Z")

</div>

You can construct it like this.

- Add a new table with all categories (say “Luxury goods” is a row, “Everyday spendings” is another row).

- Add a template column to combine the signed in user’s email with the category. (It will look like this: [johndoe@email.com](mailto:johndoe@email.com) - Luxury goods).

- In your spendings table, create the same template column.

- Create a multiple relation from the category table to the spendings table.

- Rollup to get the count of spendings and sum of amount (2 rollup columns).

---

<div class="post-metadata">

### Author: ![Martina\_G](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martina_g/32/22597_2.png) [@Martina\_G](https://community.glideapps.com/u/Martina_G)
#### Post date: [December 18, 2021, 1:49pm UTC](https://community.glideapps.com/t/how-to-filter-user-specific-data-by-category-from-another-table/36053/4 "2021-12-18T13:49:56Z")

</div>

Works really well. Thanks a lot @ThinhDinh

---

<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:57pm UTC](https://community.glideapps.com/t/how-to-filter-user-specific-data-by-category-from-another-table/36053/5 "2024-05-15T13:57:59Z")

</div>

It really work! Thank you @ThinhDinh

---

<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 15, 2024, 2:10pm UTC](https://community.glideapps.com/t/how-to-filter-user-specific-data-by-category-from-another-table/36053/6 "2024-05-15T14:10:29Z")

</div>

2 years ago there was no query column. Today you can do the same thing and filter by multiple columns.

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