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

1 Solution

Accepted Solutions
cseward1963
Creator
Creator
Author

Thank you for the suggestions.  I found that this worked perfectly

count(distinct if ( (consult + individual + direct)>0,studentid))

View solution in original post

4 Replies
sunny_talwar

May be this

Count(DISTINCT {<studentid = {"=(consult_time+individual_time+direct_time) >0"}>} studentid)

passionate
Specialist
Specialist

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

cseward1963
Creator
Creator
Author

Thank you for the suggestions.  I found that this worked perfectly

count(distinct if ( (consult + individual + direct)>0,studentid))

kaustubh
Creator
Creator

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?