Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
yh2023
Contributor III
Contributor III

aggr function returning null.

Hi everyone,

When attempting to retrieve the distinct count of 'app_yhno' across Splty a few values are null.

count(distinct app_yhno) gives counts across all dimensions, whereas applying the aggregation function aggr(count(distinct app_yhno), Splty) only produces values randomly and returns null value.

Specifically, the aim is to obtain a value of 18 for all Anaesthesia in the provided image.

yh2023_0-1710849372275.png

 

Any help is greatly appreciated.

Labels (4)
1 Solution

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

Try this instead:

Count(distinct total <Splty> app_yhno)

 

View solution in original post

3 Replies
LRuCelver
Partner - Creator III
Partner - Creator III

Try this instead:

Count(distinct total <Splty> app_yhno)

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Aggr is distinct by default. So you need to add NoDistinct as an Aggr parameter. 

aggr(NoDistinct count(distinct app_yhno), Splty)

However, as @LRuCelver suggested, Total<> is probably better than Aggr in this case.

-Rob

yh2023
Contributor III
Contributor III
Author

Thank you it works!!