Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

1 Solution

Accepted Solutions
sunny_talwar

@mscomens Try this

 

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

 

View solution in original post

4 Replies
sunny_talwar

@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

@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!