

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
count distinct if something is true
each of my data records includes these fields:
studentid
consult_time
direct_time
referral_time
eval_time
other_time
indirect_time
individual_time
date
I want to count the distinct studentid if (consult_time+individual_time+direct_time) >0
So, I'm trying to create a measure that will return a number based on the above formula.
Any ideas? I'm new to Qlik Sense.
Celia
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the suggestions. I found that this worked perfectly
count(distinct if ( (consult + individual + direct)>0,studentid))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be this
Count(DISTINCT {<studentid = {"=(consult_time+individual_time+direct_time) >0"}>} studentid)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Celia,
I would suggest
- create a column in load script as sum of all columns required.
- Create a flag whether it is greater than zero.
- Then find count in load script or on chart.
Regards,
Pankaj


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the suggestions. I found that this worked perfectly
count(distinct if ( (consult + individual + direct)>0,studentid))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a similar situation:
Sum(WildMatch(DISTINCT {<[Appt Encounter Code] = {"=[Appt Duration] =30"}>} [Appt Encounter Code],if([Appt Duration] = 20, [Appt Encounter Code])))
I wish to count the codes repeated in duration 20 that actually belongs to duration 15. My expression is giving errors. Any Suggestion to count?
