Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Shu
Contributor II
Contributor II

Load Fields only if they exist in an expression?

Hello, 

I'm new to QlikSense, so please bear with me. I'm trying to create an expression for a chart that will show the count of a field only for values that are present in another field. 

So, for example, let's say I have 2 fields, field1 and field2. Field2 has a lot of empty values but still has data. I have this simple expression for field1, count(distinct[field1]). I'm trying to figure out how to get the count(distinct[field1]) output only when there are values for field2 written in that expression. 

Any help is greatly appreciated. Thank you. 

1 Solution

Accepted Solutions
sunny_talwar

May be this

Count(DISTINCT {<field2 = {"*"}>} [field1])

So, the above expression will only count field1 if field2 isn't empty.

View solution in original post

1 Reply
sunny_talwar

May be this

Count(DISTINCT {<field2 = {"*"}>} [field1])

So, the above expression will only count field1 if field2 isn't empty.