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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
cfountain72
Creator II
Creator II

Aggr exclude zero results

Hello, 

I am using the AGGR function, but want to exclude values where the results of the calculation is zero.

=avg(aggr(count(distinct CSN), DateSK))

So, for DateSK's that have 0 CSN's, I want them to be excluded from the aggregation.

Any suggestions?

Thanks in advance,

Chris

Labels (5)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Avg(Aggr(Count({$<DateSK=E({1<CSN={'0'}>})>}DISTINCT CSN),DateSK))

View solution in original post

4 Replies
BrunPierre
Partner - Master II
Partner - Master II

Avg(Aggr(Count({<DateSK={">0"}>}DISTINCT CSN), DateSK))

cfountain72
Creator II
Creator II
Author

Thank you Peter. But this solution only exclude dates that equal 0, not the distinct count of CSN's on a given date.

BrunPierre
Partner - Master II
Partner - Master II

Avg(Aggr(Count({$<DateSK=E({1<CSN={'0'}>})>}DISTINCT CSN),DateSK))

cfountain72
Creator II
Creator II
Author

Thanks Peter!