Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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_year | tyear | tmonth | tmonthname | schoolid | disciplineid | therapistid | studentid | direct_consult |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7502 | 9005 | 1 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 8901 | 2.5 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 8908 | 0.25 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 8909 | 1 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 8968 | 0.5 |
Individual time table structure | ||||||||
school_year | tyear | tmonth | tmonthname | schoolid | disciplineid | therapistid | studentid | individual |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7502 | 9005 | 1 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 8901 | 2.5 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 8908 | 0.25 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 8909 | 1 |
2013-2014 | 2013 | 9 | September | 10817 | 65 | 7513 | 9075 | 1.5 |
Not quite clear how it looks in your data model... try
count({<direct_consult={'*'}>} distinct studentid)
May be this
count(distinct Aggr (studentid,direct_consult))
This did not work.
Try this
(count(Distinct {<direct_consult-={""}>} Aggr(studentid,therapistid,direct_consult)))
Not quite clear how it looks in your data model... try
count({<direct_consult={'*'}>} distinct studentid)
THANK YOU !!! this is working