How to count items under the column used as reference field?

I joined two database collections together using one to many, (job category, and job applicants: each applicant can apply for jobs under different category). Now I’d like to know how many applicants are under each job category. I’ve looked into how to count using WixDataQuery, but it didn’t work, as I assume the counting support only the number of rows that met the criteria. Would anyone know how to go about this? Thanks!

Hi,
You can use . eq in your query in order to get only the record that match a job category, then use results.items.length to get the number of records returned from the query.

Good luck :slight_smile:
Or