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: 
mscomens
Contributor
Contributor

Expression help needed for Count(Distinct Field1&Field2&Field3) return 0 for null in Field3

Hello community,

I am not formally trained in QlikView but find myself learning as I go. 

I have an expression for s straight table that looks like this:

Count(Distinct Field1&Field2&Field3) 

I would like something where I can do this:

Count(Distinct Field1&Field2&Field3) Where Field3 not null

I am looking to get a 0 when Field1 and Field2 still has a row in the table but Field 3 would be null in that row.

Currently Field3 is not included in the straight table as a dimension because that creates a separate row for each entry that is not null in Field3.

Values in all dimensions are strings

I hope this makes sense

Any help you could provide would be appreciated.

 

Michael

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

@mscomens Try this

 

Count({<Field3 *= {"*"}>}DISTINCT Field1&Field2&Field3)

 

View solution in original post

4 Replies
sunny_talwar
MVP
MVP

@mscomens Try this

 

Count({<Field3 *= {"*"}>}DISTINCT Field1&Field2&Field3)

 

mscomens
Contributor
Contributor
Author

Thank you Sunny! That was exactly what I needed. Can you help me understand what is happening in that expression or point me where to look at what the syntax is doing.

sunny_talwar
MVP
MVP

@mscomens - All this is saying is that include only those rows from the data where there is some data available in Field3. {<Field = {"*"}>}. Added * before = to let selection in Field3 to filter the expression

mscomens
Contributor
Contributor
Author

@sunny_talwar  - Thank you for the explanation!