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: 
ksomosera10
Creator II
Creator II

If Null, Count Distinct

Hi,

I have this expression but gives me a "No Data to Display" can you help me out on this? I'm not familiar with set analysis.

=If(Not Isnull([Name]), Count (DISTINCT [Skill]), Null())

All I want is this:

If Name is not null then count their distinct skills. If the condition is not satisfied then return null.

I hope you folk can help me out here. Thanks!

13 Replies
ashwinishinde
Partner - Contributor III
Partner - Contributor III

Hi,

   Try  This: In Script:  If (Isnull([Name]), Null(),[Name]) as Emp_Name


                    On UI  :  Count (DISTINCT [Skill])



Thanks & Regards,

Ashwini

prma7799
Master III
Master III

Try like this

=If(len(trim([Name]))>0, Count (DISTINCT [Skill]), Null())

ksomosera10
Creator II
Creator II
Author

I still get No Data to Display. I think Set-analysis is the solution to this.

prma7799
Master III
Master III

Could you please share sample app

tresesco
MVP
MVP

Try like:

=Count(DISTINCT If(len(trim([Name]))>0, [Skill]))

prma7799
Master III
Master III

please try like this

=If(isnull([Name]), Count (DISTINCT [Skill]), Null())

ksomosera10
Creator II
Creator II
Author

Thanks Tresesco for answering, but the result are the same. I get the count of all skills even when the name is null.

ksomosera10
Creator II
Creator II
Author

Capture.JPG

I still get the No data to Display

prma7799
Master III
Master III

Please share some sample app