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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Raymzzz
Contributor III
Contributor III

NULL values ignored in Aggr(Count(DISTINCT... ), ..) ?

Dear all,

can anyone tell me if NULL values are ignored in an Aggr(Count(DISTINCT ..), ..) calculated field ? I think it does because for some Counterparty's, where DealType is NULL, it doesn't count the null values as a distinct value.  For example, it gives 8 where it should give 9.

 

See example below :

=Aggr(Count({$<[Record Type]={'DEAL'}>}DISTINCT DealType),[Counterparty])

 

Many thanks in advance,

 

Stijn, Belgium

Labels (1)
1 Solution

Accepted Solutions
Raymzzz
Contributor III
Contributor III
Author

OK thanks for your reply Sunny. I was not aware that the Count function does not look at Null values.  The NullCount function however does return 0 instead of 9.

Also, the COUNT(DISTINCT DealType)  in the script part does return 9, so there it does look at NULL values..

View solution in original post

2 Replies
sunny_talwar

Count cannot count nulls, but may be you can try NullCount()

Raymzzz
Contributor III
Contributor III
Author

OK thanks for your reply Sunny. I was not aware that the Count function does not look at Null values.  The NullCount function however does return 0 instead of 9.

Also, the COUNT(DISTINCT DealType)  in the script part does return 9, so there it does look at NULL values..