Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trying to get the null count.

I have data as below

ID   Date

1    

2     1/26/2016

3   
4     3/24/2016

5     4/25/2016

Trying to get 2 countS of ID's,one with no dates and one with dates.

1.Count(if(len(Date)) >0,Date)

2.Count(if(len(Date)) =0,Date)

1 st one is giving me Count = 5 and the other one is giving me 0 count.

Thanks.

1 Solution

Accepted Solutions
adamdavi3s
Master
Master

Try this if you're just looking for an overall count

=count(if(len(Date) >0,1))

=count(if(len(Date) <1,1))

Capture.PNG

Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.

View solution in original post

9 Replies
Not applicable
Author

Correction..below is my expression.

1.Count(if(len(Date)) >0,ID)

2.Count(if(len(Date)) =0,ID)

adamdavi3s
Master
Master

Try this if you're just looking for an overall count

=count(if(len(Date) >0,1))

=count(if(len(Date) <1,1))

Capture.PNG

Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.

Not applicable
Author

Thank you .But the second expression is giving me 0 count.

adamdavi3s
Master
Master

It sounds to me like it isn't blank....

I would drop them in a table chart with len(Date) as an expression and see!

You could try a quick: Count(if(len(trim(Date))) =0,Date)

effinty2112
Master
Master

Hi Pavana,

For ID with dates:

=count({$<Date = {'*'}>}ID)

For ID with no dates

=count({$-$<Date = {'*'}>}ID)

Cheers

Andrew

Not applicable
Author

You are right...even though date is blank in the file the len(Date) is 1 !!

Not applicable
Author

How can I write this in set analysis ?

adamdavi3s
Master
Master

We'll need a bit more information to go on to advise I am afraid!

What is the formula you're trying to write?

tamilarasu
Champion
Champion

Another solution using set analysis.

=Count({<Date={"=Len(Trim(Date))>0"}>} Date)

=Count({<Date={"=Len(Trim(Date))=0"}>} Date)