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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
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!

Labels (1)
13 Replies
tresB
Champion III
Champion III

Check if this works:

=Count(DISTINCT {<[Skill]={"=len(trim([Name]))>0"}>} [Skill]))

antoniotiman
Master III
Master III

Hi Kevin,

try

=Count({<Name={*}>} DISTINCT Skill)

Regards,

Antonio

Kushal_Chawda
MVP
MVP

I would suggest to create the Flag in script,

LOAD *,

          if(len(trim(Name))>0,1,0) as NameFlag

FROM table

now you can use the set analysis like below

=count(distinct{<NameFlag={1}>}Skill)


or set analysis


=count(DISTINCT{<Name ={*}>}Skill)

Chanty4u
MVP
MVP

try this

=count( if(IsNull(Field),Dim))