Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jleefjcapital
Contributor

Creating measures

I just created a measure setting min and max values-

Here's the code.

Sum({$<[100% Composite Index] ={">=$(=vMin) <=$(=vMax)"}>} [100% Composite Index])

However, if there is no value, it's appearing as zero rather than null.  How do I get it to display a null value?

Thank you,

Jessica

8 Replies

Re: Creating measures

Try this:

If(Sum({$<[100% Composite Index] ={">=$(=vMin) <=$(=vMax)"}>} [100% Composite Index]) = 0, Null(), Sum({$<[100% Composite Index] ={">=$(=vMin) <=$(=vMax)"}>} [100% Composite Index])

jleefjcapital
Contributor

Re: Creating measures

It actually null out the field. 

Re: Creating measures

If you still want to see the field, you will have to uncheck the below option on the presentation tab of properties:

Capture.PNG

I hope that will resolve your issue

Best,

Sunny

jleefjcapital
Contributor

Re: Creating measures

Is this for Qlik View?  I don't have that feature in Qlik Sense...at least I don't think I do.

sinanozdemir
Valued Contributor III

Re: Creating measures

Hi Jessica,

On the right pane, in the data section you should be able to see options for each dimensions to show null values:

Capture.PNG

jleefjcapital
Contributor

Re: Creating measures

I'm actually not interested in removing the null values.  I just want to get the null values to appear rather than the zero value.  Is this something I need to code in the measure? 

Re: Creating measures

Use this expression

If(Sum({$<[100% Composite Index] ={">=$(=vMin) <=$(=vMax)"}>} [100% Composite Index]) = 0, Null(),Sum({$<[100% Composite Index] ={">=$(=vMin) <=$(=vMax)"}>} [100% Composite Index])

and then check Show null values  as Sinan Ozdemir‌ just showed.

jleefjcapital
Contributor

Re: Creating measures

Additionally, when I change the aggregator from Sum to Avg, I get null values.   Is there a way to apply the average ? 

Community Browser