I need to create a report that has a distinct count (not just a count.) I have run into this problem many times and I have never found a good way to deal with it. So, I’m hoping there is some easy solution I’m missing. I’ll give my specific example for context.
My app records activities by resource specialists who provide assistance to patients. There is a patient table that is joined with an activities table (one patient can be associated with many activities.) The manager wants to assess the workload of her resource specialists. It is easy enough to count the activities by resource specialists or even the patient IDs linked to the activities, but the manager wants to answer the simple question about how many UNIQUE patients were helped.
I can group by the patient ID, but we are talking about very large numbers that bog down the report and makes it unusable. It also is not really the correct way to look at this. A calculated column that counts patients is the same as the counting the record. I need something like the SQL function “COUNT (DISTINCT ... “
In searching through this forum I found some people having similar issues and a reference to an underscore.js function HERE, but I’m looking for the most straightforward way to do this seemingly straightforward request. Thanks!