# How can I count the number of clients a user has created?

**URL:** <https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268>\
**Category:** Ask for Help\
**Created:** [January 3, 2023, 9:33am UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268 "2023-01-03T09:33:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rev](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rev](https://community.glideapps.com/u/Rev)\
**Post date:** [January 3, 2023, 9:33am UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/1 "2023-01-03T09:33:34Z")

</div>

Happy new year!

I’m hoping you can help me - I’m creating a customer portal that allows businesses to add their own clients to a dashboard. I’m trying to figure out how to filter the dashboard to show the count of clients for a specific business, rather than the total number of clients for all businesses.

Here’s the example data I’m playing with:

 ![Screen Shot 2023-01-03 at 8.30.01 pm](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/5/e549c78cd42b229bc55a77f162ecba7890f75c73.png)

In terms of displaying the data, I am hoping to achieve something similar to the big numbers image below. Using the example data above, if we were looking at ACME, they have 4 clients, so if ACME is logged in, they will only see the count for the clients they have created (4 in this example). Likewise, if XYZ Ltd were looking at their dashboard, they have 2 clients so their count would show 2.

The other users have an ‘Admin’ role, so shouldn’t be counted as a client.

 ![Screen Shot 2023-01-03 at 8.06.28 pm](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/5/e5d983251ce95468dbc5b3bea576278fae00c6c0.png)

Thanks in advance for any tips!

---

<div class="post-metadata">

**Author:** ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)\
**Post date:** [January 3, 2023, 11:18am UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/2 "2023-01-03T11:18:50Z")

</div>

The easiest way to do this would be to create a multi-relation that relates the Business column to itself. This will find all instances/rows for each business in this sheet. Then all you’d have to do is add a Rollup column that counts the number of matches (from that multiple relation).

---

<div class="post-metadata">

**Author:** ![Rev](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rev](https://community.glideapps.com/u/Rev)\
**Post date:** [January 3, 2023, 11:49am UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/3 "2023-01-03T11:49:31Z")

</div>

Thanks @kyleheney, your method worked! How would I make it so it only counts rows that have the ‘Client’ role instead of ‘Admin’? The current count includes all rows belonging to the business, which includes ‘admin’ accounts which aren’t ‘clients’.

The below example shows all rows belonging to ACME - 4 clients and 1 admin account. Ideally the count would only include the 4 ‘client’ rows. Any ideas?

 ![PastedGraphic-1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/f/9f67444f29dc18860c1f8f494506db2d17866f05.jpeg)

---

<div class="post-metadata">

**Author:** ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)\
**Post date:** [January 3, 2023, 11:52am UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/4 "2023-01-03T11:52:31Z")

</div>

In this case, there are a couple ways to do this. I think what I would suggest would be to simply add an IF THEN column that checks if the row is Admin. If it is, write the Business, else write nothing. Then build your Multiple Relation from that IF THEN column instead.

---

<div class="post-metadata">

**Author:** ![Rev](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rev](https://community.glideapps.com/u/Rev)\
**Post date:** [January 3, 2023, 11:58am UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/5 "2023-01-03T11:58:25Z")

</div>

@kyleheney - that did the trick! Thanks for all your help, really appreciate it!

 ![PastedGraphic-2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/9/190f01dbcb4d785980c1f9751ed0af6cc66d9ff3.jpeg)

Also a shoutout to @nathanaelb who gave some suggestions over PM!

---

<div class="post-metadata">

**Author:** ![Rev](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rev](https://community.glideapps.com/u/Rev)\
**Post date:** [January 3, 2023, 12:08pm UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/6 "2023-01-03T12:08:42Z")

</div>

@kyleheney - I may have jumped the gun. When viewing the dashboard as the Admin user, the count shows 0. How would I allow the admin users to see the count of 4 clients?

---

<div class="post-metadata">

**Author:** ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)\
**Post date:** [January 3, 2023, 12:21pm UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/7 "2023-01-03T12:21:01Z")

</div>

Make sure you’re viewing the correct row of data on your screen. Filter it by the row/screen you’re currently viewing. I’m guessing it’s showing you the data for the wrong row.

Is it possible you have Row Owners enabled too?

---

<div class="post-metadata">

**Author:** ![Rev](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@Rev](https://community.glideapps.com/u/Rev)\
**Post date:** [January 3, 2023, 12:29pm UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/8 "2023-01-03T12:29:49Z")

</div>

Ah, just didn’t set the page filter! Thanks again!

---

<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:** [January 4, 2023, 12:30pm UTC](https://community.glideapps.com/t/how-can-i-count-the-number-of-clients-a-user-has-created/56268/9 "2023-01-04T12:30:25Z")

</div>

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