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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasx15
Contributor III
Contributor III

Count Zeros in Column and expression

Hello everybody! I'm trying to count zeros in a line, however, the value is returning null. I have NR_CLIENT_NUMBER as dimension.

TOTAL ZERO.jpg

This is my expression:

IF(COUNT({<CD_POSTAL={605}, SEQ_TYPE={5757}>}DISTINCT NR_CLIENT_NUMBER)=0, COUNT({<CD_POSTAL={605}, SEQ_TYPE={5757}>}DISTINCT NR_CLIENT_NUMBER))
Labels (1)
3 Replies
BrunPierre
Partner - Master II
Partner - Master II

Maybe like this?

Count({<NR_CLIENT_NUMBER={"=COUNT({<CD_POSTAL={605}, SEQ_TYPE={5757}>}DISTINCT NR_CLIENT_NUMBER)=0"},CD_POSTAL={605}, SEQ_TYPE={5757}>} DISTINCT NR_CLIENT_NUMBER)

lucasx15
Contributor III
Contributor III
Author

Hi, @BrunPierre !

Thank you for reply!

I used this expression, however, it returned 0 and not the count of lines with zero. In this case, it should return 7 and not 0.

zero02.jpg

 

BrunPierre
Partner - Master II
Partner - Master II

Sum(If(Count({<NR_CLIENT_NUMBER={"=COUNT({<CD_POSTAL={605}, SEQ_TYPE={5757}>}DISTINCT NR_CLIENT_NUMBER)=0"},CD_POSTAL={605}, SEQ_TYPE={5757}>} DISTINCT NR_CLIENT_NUMBER)=0,1))