1 Reply Latest reply on Apr 12, 2019 9:12 AM by Govind Acharya

    Counting Students Who Passed a Credit Hours Benchmark


      As a Tableau newbie, I'm using calculated fields for the first time and could use some help. I want to count the students in a cohort who completed at least 12 credit hours during a certain academic term with passing grades.


      The problem is that the view seems to be counting the number of passed courses instead of students. In Access (a program I know much better), I counted 132 course sections passed by 45 students in this cohort during the term. But the Tableau view counts 132, not 45.


      In the attached .twbx, you can see two filters: Term and Grade. The term I want is 14/SS, the grades A, B, C, and D.


      You'll also see two calculated fields: Above12Credits? and Students>=12Credits. Above12Credits? applies this formula:

      IF SUM([Credit Hours]) >= 12

      THEN '>= 12'

      ELSE '< 12'



      Students>=12Credits has this formula:

      IF [Above12Credits?] = '>= 12'

      THEN COUNTD([Students])



      The intention is to count only those students whose passed credit hours total at least 12 and to count each student only once.


      What do I need to do to make the view count students rather than course sections?

        • 1. Re: Counting Students Who Passed a Credit Hours Benchmark
          Govind Acharya

          Hi Curtis,


          This might not be the *best* approach. But I've attached the workbook with the totals that you expected to get. I changed the "Above 12 credits" field to the following calculation:


          IF {fixed [Students]: sum([Credit Hours])} >= 12

          THEN '>= 12'

          ELSE '< 12'



          Then I added the "Grade" and "Term" fields to context by right clicking and adding to context as seen in the screenshot attached. I also created a "Distinct students" calculated field. The attached workbook was saved as Tableau version 2019.1.2. The "distinct students" column in the worksheet is what to use.


          1 of 1 people found this helpful