Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Insider: SaaS capabilities for Data Integration and Analytics, May 25th! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
adnbbh
Contributor II
Contributor II

Count all distinct values is the corresponding field is not equal to null

Hi everyone, I'm completely new to Qlik and there's a problem that I've encountered and I'd appreciate your help;

So I'm trying to count distinct values of a certain field (ID) if the values of a corresponding field (Card) are not equal to null and I also want this number to be not bound to selection, therefore the All parameter - I know this is a simple task but I'm still struggling, especially with the qlik syntax.

This is what I've got so far:

Count({[Card]<>NULL} ALL DISTINCT [ID])

Thank you in advance!

1 Solution

Accepted Solutions
joseph_morales
Creator II
Creator II

Hi @adnbbh 

Can you try this:

=count({1<[Card]={"<>'-'"}>} DISTINCT  [ID])
 or 

=count({1<[Card]={"<>' '"}>} DISTINCT  [ID])

Another way
=count({1} DISTINCT if(not IsNull([Card]),[ID]))
Best Regards,
Joseph Morales

View solution in original post

2 Replies
joseph_morales
Creator II
Creator II

Hi @adnbbh 

Can you try this:

=count({1<[Card]={"<>'-'"}>} DISTINCT  [ID])
 or 

=count({1<[Card]={"<>' '"}>} DISTINCT  [ID])

Another way
=count({1} DISTINCT if(not IsNull([Card]),[ID]))
Best Regards,
Joseph Morales
adnbbh
Contributor II
Contributor II
Author

Hi Joseph, sorry for the late reply - got a bit chaotic; anyway. the first two solutions seem to work and I think I got a better idea on set analysis in the meantime - thank you very much!