Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

bi_analysts_2
New Contributor III

Count if not null

Hi,

how should I write the measure function if I want it to count 1 of the dimensions only if the value is not null?

For example, currently the expression is: Count([demo column])

but I don't want it to count the null rows..

Thanks,

Tal

Tags (1)
1 Solution

Accepted Solutions

Re: Count if not null

Hi Tal, maybe is loading as a blank value (not a null value), If you can select the value it's not null, can you try selecting it?

Maybe you can add a condition while loading:

If(Len(Trim(Field))=0, Null(), Field)

8 Replies

Re: Count if not null

May be like this:

Count({<Field1 = {'*'}>}Field2)

MVP
MVP

Re: Count if not null

The Count() function does not count NULL, so you either don't need to do anything special or I don't understand what you are trying to do here.

bi_analysts_2
New Contributor III

Re: Count if not null

Hi Swuehl,

I would expect it also not to count the null values (as it was when I perform this on Qlik sense desktop), but now I am performing a visualization on Qlik sense web and it does count the null values and displays the result.. (pic below)

Count Null.PNG

bi_analysts_2
New Contributor III

Re: Count if not null

Is this the syntax for Qlik sense web?

Re: Count if not null

I would think it should work in any of the Qlik product. Have you tried it?

Re: Count if not null

Hi Tal, maybe is loading as a blank value (not a null value), If you can select the value it's not null, can you try selecting it?

Maybe you can add a condition while loading:

If(Len(Trim(Field))=0, Null(), Field)

bi_analysts_2
New Contributor III

Re: Count if not null

I dont understand what is Field1 and Field2?

I am interested to count the values of dimension 'demo column' (if not null of course)

bi_analysts_2
New Contributor III

Re: Count if not null

I was loading as blank value, thank you Ruben - good thinking!

Community Browser