Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count Distinct

I'm looking to count distinct ID's where postcode is null and consent is yes.  I can get the formula to work before adding the distinct part but this is giving me the same person on more than one occasion, hence the need to make it distinct. So the formula I have is - sum(if(isnull(NDTMSdat) and NDTMSconsent='Y',1)) how do I get this to one count per person?

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hm, not sure, but try

=count(DISTINCT if(isnull(NDTMSdat) and NDTMSconsent='Y', PersonID))

if PersonID is your person field.

Hope this helps,

Stefan

View solution in original post

5 Replies
its_anandrjs
Champion III
Champion III

Hi,

Use some thing

sum(if(isnull(NDTMSdat) = -1 and NDTMSconsent='Y',1))

  

Rgds

Anand

swuehl
MVP
MVP

Hm, not sure, but try

=count(DISTINCT if(isnull(NDTMSdat) and NDTMSconsent='Y', PersonID))

if PersonID is your person field.

Hope this helps,

Stefan

SunilChauhan
Champion II
Champion II

try this

sum(distinct if(isnull(NDTMSdat) and NDTMSconsent='Y',1))

Sunil Chauhan
SunilChauhan
Champion II
Champion II

or if u have Id then

sum(distinct if(isnull(NDTMSdat) and NDTMSconsent='Y',IDfield))

Sunil Chauhan
Not applicable
Author

Fantastic, thank you.