# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor III

## Count the number of students each teacher has in a table

Hi Data

My data set is made up of 6 Grades, 20 Teacher, 275 Student and not every teacher teaches every Grade

I need a table that has Teacher Name, No. of Grades, No. of Student but I end up getting 6 Grades and 275 students for every teacher.

My expression is...  Aggr(Count(distinct [Grade]), [Teacher])

What am I doing wrong?

Neil

Tags (1)
1 Solution

Accepted Solutions
MVP

## Re: Count the number of students each teacher has in a table

Do you have Teacher and Grade in separate tables? Is the data model well connected if the data is coming from different tables? Also, if you Teacher Name as a dimension, then your expression should be enough (assuming that the data model is well linked)

3 Replies
Valued Contributor

## Re: Count the number of students each teacher has in a table

Because this is unusual.

MVP

## Re: Count the number of students each teacher has in a table

Do you have Teacher and Grade in separate tables? Is the data model well connected if the data is coming from different tables? Also, if you Teacher Name as a dimension, then your expression should be enough (assuming that the data model is well linked)