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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
baylor2016
Creator
Creator

How to get record count for null (blank or missing) ?

Hi,

After reviewing many posts related to null(missing, blank) fields, I still cannot figure out how to get the correct counts for field whose value is null, missing or blank.  can get the non-null counts by using =COUNT( {<Enddate={*}>} PAT_ID). For count of null field I used =COUNT( {<Enddate-={*}>} PAT_ID), it always return 0. I tried many different methods such as =COUNT( {<Enddate-={'-'}>} PAT_ID), still cannot get it right. Please advice. The sample project is attached.

Thanks

Longmatch

11 Replies
baylor2016
Creator
Creator
Author

Thank you for your helps to solve my problem. Do you know why =COUNT( {<PAT_ID= {"=Len(Trim(Enddate)) = 0"}>} PAT_ID) does not work in straight table? Just curious. Thanks as always.

sunny_talwar

If you see the Aggr() function it needed to use three dimensions rather than just PAT_ID

Count(DISTINCT Aggr(If(Len(Trim(Enddate)) = 0, PAT_ID), PAT_ID, CITY, Enddate))

So, basically what you are testing is not just against PAT_ID like in the below expression

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

But against, three fields like this

=Count({<PAT_ID&CITY&Enddate = {"=Len(Trim(Enddate)) = 0"}>} PAT_ID)

But the above syntax is not right, so that is why you cannot do this is set analysis unless you create a new field which combines the three field into one in script

AutoNumber(PAT_ID&CITY&Enddate) as NewField...


Now you can use this

=Count({<NewField = {"=Len(Trim(Enddate)) = 0"}>} PAT_ID)

Does this make sense?