# Help with count of specific items ordered by a client

**URL:** <https://community.glideapps.com/t/help-with-count-of-specific-items-ordered-by-a-client/82307>\
**Category:** Ask for Help\
**Created:** [June 7, 2025, 6:23pm UTC](https://community.glideapps.com/t/help-with-count-of-specific-items-ordered-by-a-client/82307 "2025-06-07T18:23:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gebby](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gebby/32/84815_2.png) [@Gebby](https://community.glideapps.com/u/Gebby)\
**Post date:** [June 7, 2025, 6:23pm UTC](https://community.glideapps.com/t/help-with-count-of-specific-items-ordered-by-a-client/82307/1 "2025-06-07T18:23:58Z")

</div>

Hi all, I feel like this probably a very simple answer that I’m just too deep in to it to see. But here’s the situation. I have an Orders table that has a Client column and an Product column. What I need to check is that a specific client, has not ordered over X amount of a specific product.

Here’s a mock up:

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

As you can see, I want to get a count in column 4 of how many Cokes for example, ClientA has ordered. I can do the Limit and Error fields just fine once I have the count of orders per client.

My attempts so far have been to do a self relation column based on Client field = Client field and then a rollup through that link of the Product field but that gives me crazy numbers. The other method is a self relation on the Product field but that gives me the total number of that product ordered, instead of the total number of that product ordered per client. Any help would be greatly appreciated.

I don’t have a lot of wiggle room in terms of the structure of the data.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [June 7, 2025, 7:17pm UTC](https://community.glideapps.com/t/help-with-count-of-specific-items-ordered-by-a-client/82307/2 "2025-06-07T19:17:19Z")

</div>

Hello @Gebby 🙂

> [@Gebby](#):
>
> I don’t have a lot of wiggle room in terms of the structure of the data

Without changing the structure, you could do the following:

1. Create a _Query_ column (instead of a _Relation_). It will allows you to filter on both the _Client_ and _Product_. `Query for this Client and Product` for example. The filter must be _Category_ is _This row \> Category_ (and same for _Product_).

  

1. Create a _Rollup_ column (`Count of HMTCHO`, I was lazy copying your column’s name here 😃 ). You can apply a _Count unique_ if you have a real RowID (your’s is not in the screenshot). Or just a _Count_ of basicaly… whatever column.

  

1. Lastly, an _If → Then → Else_ column to check if the value is over the limit, let’s call it `Over Limit?`.

  

You should obtain this in your `Orders` table:

 ![Orders](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/b/bbfab2e9de516b624180e5c8c3a3050b9ba2a281.png)

  

Hope you’ll find this helpful 👍

---

<div class="post-metadata">

**Author:** ![Gebby](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gebby/32/84815_2.png) [@Gebby](https://community.glideapps.com/u/Gebby)\
**Post date:** [June 7, 2025, 7:25pm UTC](https://community.glideapps.com/t/help-with-count-of-specific-items-ordered-by-a-client/82307/3 "2025-06-07T19:25:03Z")

</div>

Wow this is literally perfect. Thank you so much. I’ve not really used the Query very much so this is a great learning experience!

---

<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 14, 2025, 7:25pm UTC](https://community.glideapps.com/t/help-with-count-of-specific-items-ordered-by-a-client/82307/4 "2025-06-14T19:25:27Z")

</div>

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