Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
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
Partner - Master

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
Partner - Master

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))