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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register 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
tresesco
MVP
MVP

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

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))