Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cseward1963
Contributor

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
Contributor

Re: count distinct if something is true

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

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

3 Replies
MVP
MVP

Re: count distinct if something is true

May be this

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

passionate
Valued Contributor

Re: count distinct if something is true

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
Contributor

Re: count distinct if something is true

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

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