How to count for rows in another table

Hi there,

I have two tables: BEN and EMP. Inside EMP there is a column called empCode, which is also present in BEN. I would like to create a column in EMP, that will count how many times the empCode matches rows inside BEN empCode column.

On Excel, I would run this formula =COUNTIF(ben!C:C,emp!C2). When I use the same on Glide, it doesn’t seem to be able to reference items from another table. I also tried the JavaScript feature, but I could not find any docs that describe how to deploy and use a table in there, so I can access it.

Let’s say EMP has two rows and their empCode values are ABC, DEF. Inside BEN there are 8 rows: ABC, DEF, DEF, ABC, DEF, ABC, ABC, DEF. Thereby my column in EMP, lets name it Total, would then need to show 4 in the row that has ABC, and 4 in the row that has DEF.

Create two columns in your EMP table:

  • First, a multiple relation that matches the empCode with the same column in your BEN table
  • Then a rollup column that does a count via the relation column
2 Likes

Thanks, this works!

@Darren_Murphy may I ask more questions or must I make a new topic?

Better to make a new topic.

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