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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinM
Contributor III
Contributor III

Distinct count only non-blank cells

Hi

I'm trying to distinct count a column of cells but ignore the cells with blank values.

I've tried this

Count({<sRefNo = {"=Sum(sRefNo) = 0"}>}DISTINCT sRefNo)

which works to count but it includes the blank in the answer

The below attempt says I'm missing a ")"

Count(if(not isnull(sRefNo),distinct sRefNo))

Please help

1 Solution

Accepted Solutions
Anil_Babu_Samineni
MVP
MVP

Perhaps this for second one?

Count(distinct if(not isnull(sRefNo), distinct sRefNo))

Or

Count({<sRefNo={"=Len(sRefNo)>=0"}>} sRefNo)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Anil_Babu_Samineni
MVP
MVP

Perhaps this for second one?

Count(distinct if(not isnull(sRefNo), distinct sRefNo))

Or

Count({<sRefNo={"=Len(sRefNo)>=0"}>} sRefNo)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
JustinM
Contributor III
Contributor III
Author

Much appreciated. It worked. The only change I made to yours was the "=Len(sRefNo)>=0" changed to "=Len(sRefNo)>0"