# Counting different record per row

**URL:** <https://community.glideapps.com/t/counting-different-record-per-row/74729>\
**Category:** Ask for Help\
**Tags:** tutorial\
**Created:** [July 9, 2024, 5:12am UTC](https://community.glideapps.com/t/counting-different-record-per-row/74729 "2024-07-09T05:12:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelo.deguzman](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/marcelo.deguzman/32/74327_2.png) [@marcelo.deguzman](https://community.glideapps.com/u/marcelo.deguzman)\
**Post date:** [July 9, 2024, 5:12am UTC](https://community.glideapps.com/t/counting-different-record-per-row/74729/1 "2024-07-09T05:12:20Z")

</div>

Hi everyone,

I am having a bit of a problem when counting data from another table.

For example,

on another table called leave\_application, there was a record there that is list of leaves (vacation leave, sick leave, etc.) and status was approved, pending and rejected.

And on another table called emp\_list (which the data per people is on there).  
I want to count per leave that is applied and added to the leave\_application.

Is there a way to do this?

What I’ve done now is, create a relation between these two table using the email address as their unique identifier and then match multiple, but what is next? Do I use a vlookup excel formula or lookup to get all the different tags, and recount is on different columns?

Thanks for the help.

---

<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:** [July 9, 2024, 9:23am UTC](https://community.glideapps.com/t/counting-different-record-per-row/74729/2 "2024-07-09T09:23:52Z")

</div>

Do you have another table that lists the different leave types?

If not, I would create such a table and do the calculation in that table.

- Modify the action that opens a user details screen so that it first sets the user email in a “temporary” column in the user profile table.
- Then create a Query column in the Leave Types table that targets the Leave Applications table, and apply the following filters:  
– Email is User Profile-\>Temporary Email Column  
– Leave Type is This row-\>Leave Type
- You can then use a rollup column that targets the query column to count each type of leave.

---

<div class="post-metadata">

**Author:** ![marcelo.deguzman](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/marcelo.deguzman/32/74327_2.png) [@marcelo.deguzman](https://community.glideapps.com/u/marcelo.deguzman)\
**Post date:** [July 10, 2024, 12:58am UTC](https://community.glideapps.com/t/counting-different-record-per-row/74729/3 "2024-07-10T00:58:23Z")

</div>

Hi @Darren_Murphy ,

I have created this one

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

code = Single Value from selected (entitled leave) from other source, it has multiple value, and separated by comma (,). So I get the first value and reflected on this  
approved = using code as id, I query it so I get the row(s) per user.  
approved\_count = rollup count for approved  
relation-credits = another relation to table (leave-credits), to get some info  
leave\_details = getting the label for the code (from leave-credits table)  
entitled\_num = getting the total leave (from leave-credits)  
remaining = Math formula (entitled\_num - approved\_count)  
display = template format for the leave.

#### Sick Leave: remaining/entitled\_num

My problem now is in the approved\_count. I want to get the column remaining days from other table, but I can’t get the data. I tried to use the lookup function, but there was an error. I use the relation for leave#1/approved (or the query source).

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/0/f02c25f25108c3c4c2c61c035b3ca8dcce8301c6.png)

Do you know how to fix this?

My problem here is mostly I cannot get the column I want to do a sum up.

Thank you very much.

---

<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:** [July 10, 2024, 1:06am UTC](https://community.glideapps.com/t/counting-different-record-per-row/74729/4 "2024-07-10T01:06:15Z")

</div>

> [@marcelo.deguzman](#):
>
> My problem now is in the approved\_count. I want to get the column remaining days from other table, but I can’t get the data. I tried to use the lookup function, but there was an error. I use the relation for leave#1/approved (or the query source).

A Lookup in this context is going to return an array, which I believe is not what you want.  
Try using a Single Value column instead.
