

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count if not null
Hi Everyone
I have table like this
Date | UserId |
---|---|
01/01/2018 | 23625 |
01/01/2016 | 36251 |
Null | 20148 |
Null | 32598 |
05/06/2018 | 14587 |
I want a measure to Count UserId whose date is not null
I found lots of options but none of them is working.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If so: try:
count({<Date=-{'Null'}>}UsedId)
or
count({<Date=-{''}>}UsedId)
or
count({<Date=-{"=len(trim(Date))=0"}>}UsedId)
or
count({<Date=-{"=isNull(Date)=-1"}>}UsedId)
(depends on how ur null values are defined)
ps: Qlik does not count Null values that appear as '-' in grey

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How are ur Null values defined? as a strgin 'Null' ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If so: try:
count({<Date=-{'Null'}>}UsedId)
or
count({<Date=-{''}>}UsedId)
or
count({<Date=-{"=len(trim(Date))=0"}>}UsedId)
or
count({<Date=-{"=isNull(Date)=-1"}>}UsedId)
(depends on how ur null values are defined)
ps: Qlik does not count Null values that appear as '-' in grey


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure what the problem is here - Count() only counts non-nulls by default.
Perhaps if you provided slightly more information, the problem would be clearer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think his Null values are defined as Strings.. not really Null values.. but maybe spaces.. don't know


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi omarbensalem
Thanks for your answer
Out of 4 answers , 3 are working for me.
I don't know how my null values are defined but it appears as '-' in grey.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count({<AAA =- {'=len(trim(AAA))=0'} >}BBB)
or
Count({<AAA =- {''} >}BBB)
