

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
count (distinct if . . . . . .
Hello All.
This works for me:
count(distinct if (DC>0,studentid)) - count students who received direct or consult services
and this works too:
count( distinct if ( (Ref>0) ,studentid )) - count students who were screened or evaluated
BUT, this does NOT work:
count( distinct if ( (Ref>0) and (DC>0) ,studentid )) - count students who were screened or evaluated and who received direct or consult services; this expression always returns a ZERO

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
count({<ref={‘>0’},DC={‘>0’} } studentid)
or
count(Distinct{<ref={‘>0’},DC={‘>0’} } studentid)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
use set analysis instead
Count ({<ref={">0"},DC={">0"}>} distinct studentid)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if I am recalling right. there is a Function AND() you would have to use.
Let me see if I can provide you a detail.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
count( distinct if ( AND(Ref>0,DC>0) ,studentid ))
or
count( distinct if (Ref>0 and DC>0 ,studentid ))
and May be this
count( aggr(distinct if (Ref>0 and DC>0 ,studentid )))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Martin Pohl, thank you for your reply, your expression:
Count ({<ref={">0"},DC={">0"}>} distinct studentid)
is acceptable to the Editor, but it returns the same value as
count(distinct if (DC>0,studentid))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
you can try below method,
Method 1: by creating cal. measure using set analysis
Count(distinct {$<Ref={">0"},DC={">0"}>} studentid
Method 2: by creating cal. measure using if condition
if(Ref>0 and DC>0, count(distinct studentid) )
Thanks,Deva


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Your expression should have worked, something else is happening.Yes, set analysis is better, but your expression should've worked,
Please share more information such as app, data, screenshots?
Cheers,
Luis
