5 Replies Latest reply: May 1, 2017 11:08 AM by Celia Seward RSS

    count(distinct) on specific table

    Celia Seward

      My application has many related tables.  Each table represents a certain type of billed time.  Below is a sample of data from 2 of the tables.  All the other tables have the same columns with the last column being the unique time type.  I want to count(distinct(studentid) for the "DirectConsult" table only.  I tried this if(sum(direct_consult)>0,count(distinct(studentid)),0) , but it didn't work.  The if statement returned the count of all unique studentids.   I just want the count of unique studentids in the table "DirectConsult".  I hope someone has a suggestion.  Thanks.

       

          

      DirectConsult time table structure
      school_yeartyeartmonthtmonthnameschooliddisciplineidtherapistidstudentiddirect_consult
      2013-201420139September1081765750290051
      2013-201420139September1081765751389012.5
      2013-201420139September1081765751389080.25
      2013-201420139September1081765751389091
      2013-201420139September1081765751389680.5
      Individual time table structure
      school_yeartyeartmonthtmonthnameschooliddisciplineidtherapistidstudentidindividual
      2013-201420139September1081765750290051
      2013-201420139September1081765751389012.5
      2013-201420139September1081765751389080.25
      2013-201420139September1081765751389091
      2013-201420139September1081765751390751.5