Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
cseward1963
Creator
Creator

count(distinct) on specific table

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
1 Solution

Accepted Solutions
Anonymous
Not applicable

Not quite clear how it looks in your data model...  try

count({<direct_consult={'*'}>} distinct studentid)

View solution in original post

5 Replies
aarkay29
Specialist
Specialist

May be this

count(distinct Aggr (studentid,direct_consult))

cseward1963
Creator
Creator
Author

This did not work.

aarkay29
Specialist
Specialist

Try this

(count(Distinct {<direct_consult-={""}>} Aggr(studentid,therapistid,direct_consult)))

Anonymous
Not applicable

Not quite clear how it looks in your data model...  try

count({<direct_consult={'*'}>} distinct studentid)

cseward1963
Creator
Creator
Author

THANK YOU !!! this is working