# How to count number of entries based on two parameters

**URL:** https://community.glideapps.com/t/how-to-count-number-of-entries-based-on-two-parameters/28293
**Category:** Ask for Help
**Created:** [June 23, 2021, 9:32pm UTC](https://community.glideapps.com/t/how-to-count-number-of-entries-based-on-two-parameters/28293 "2021-06-23T21:32:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [June 23, 2021, 9:32pm UTC](https://community.glideapps.com/t/how-to-count-number-of-entries-based-on-two-parameters/28293/1 "2021-06-23T21:32:50Z")

</div>

What is the best way to find out how many bookings a team has done on each date

I have two tables

_Table Bookings_

| Date | Team |
| --- | --- |
| 21-6-2021 | MM |
| 21-6-2021 | MM |
| 21-6-201 | Lead |

_Table Datetable_

| Date | Team MM bookings on date |
| --- | --- |
| 21-6-2021 | 2 |

If I could do SQL I would do something like for Team MM bookings on date:  
Count(select Bookings.Team from Bookings, Datetable where Bookings.Date=Datetable,Date and Bookings.Team=‘MM’)

What I do **instead** is to create a template columns, relation columns and rolloup

_Table Bookings_

| Date | Team | tpl Team on date |
| --- | --- | --- |
| 21-6-2021 | MM | MM21-6-2021 |
| 21-6-2021 | MM | MM21-6-2021 |
| 21-6-201 | Lead | Lead21-6-2021 |

_Table Datetable_

| Date | tpl team on date | rel MM bookings | Team MM bookings on date |
| --- | --- | --- | --- |
| 21-6-2021 | MM21-6-2021 | MM21-6-2021 MM21-6-2021 | 2 |

_rel MM bookings_ is relation column with multiple match and the match is _tpl Team on date_  
_MM bookings on date_ is a rollup column where _rel MM bookings_ is counted

**But is there a better way?**

---

<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: [June 23, 2021, 9:39pm UTC](https://community.glideapps.com/t/how-to-count-number-of-entries-based-on-two-parameters/28293/2 "2021-06-23T21:39:07Z")

</div>

That’s exactly how I would (and do) do it.

---

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [June 23, 2021, 9:52pm UTC](https://community.glideapps.com/t/how-to-count-number-of-entries-based-on-two-parameters/28293/3 "2021-06-23T21:52:09Z")

</div>

Thx. It just adds a lot of columns to the tables when you have quite a few teams.

Conditional rollup would be so great (from this post [Lookup all users but himself - #3 by Jeff\_Hager](https://community.glideapps.com/t/lookup-all-users-but-himself/21317/3))

> [@Lookup all users but himself](https://community.glideapps.com/t/lookup-all-users-but-himself/21317/3):
>
> just to handle some heavy processing that a conditional relation or conditional rollup would fix easily, and I’m trying to get away from having to do any formulas in the google sheet so I can avoid any lag. I feel like I’m so close, because I think I know what’s causing the slowness and what needs to happen to speed it up, but I just can’t find a better workaround.

---

<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: [June 23, 2021, 9:54pm UTC](https://community.glideapps.com/t/how-to-count-number-of-entries-based-on-two-parameters/28293/4 "2021-06-23T21:54:33Z")

</div>

yep, absolutely agreed.
