Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

stuhico09
Contributor

How can I display result which is greater than 0?

Dear Friend,

My result display value which include 0 & negative. how to modified my formula to exclude it? Thanks.

Have a nice day :-)

=Count({$<[SR No]={"=Min ({<Temp = {'Task_1'}>}[Date Created]) >=  MakeDate(2018,1,15)"}>

*$<[SR No]-={"''"}>

*$<[Gate]={"Gate C"}>

}

(Gate))-count([SR No])

1 Solution

Accepted Solutions
stuhico09
Contributor

Re: How can I display result which is greater than 0?

Dear All,

Correct answer as below. Thanks.

sum(Aggr(



if(


(Count({$<[SR No]={"=Min ({<Temp = {'Task_1'}>}[Date Created]) >=  MakeDate(2018,1,15)"}>


*$<[SR No]-={"''"}>


*$<[Gate]={"Gate C"}>



}(Gate))-count([SR No]))>0,




(Count({$<[SR No]={"=Min ({<Temp = {'Task_1'}>}[Date Created]) >=  MakeDate(2018,1,15)"}>


*$<[SR No]-={"''"}>


*$<[Gate]={"Gate C"}>



}(Gate))-count([SR No])),




'No repetition') , [SR No]))


ssd.PNG

6 Replies
_armoco_
Contributor II

Re: How can I display result which is greater than 0?

Put the expression in a variable and use an if condition?

if($(your variable)>0, $(your var), 'val have 0's and negative')

stuhico09
Contributor

Re: How can I display result which is greater than 0?

Hi Arjun,

I manage to get the display in table. but how im gonna show the total in KPI object? it showing NaN.Could be due to the text. it should  show 8 instead of NaN.

if(

(Count({$<[SR No]={"=Min ({<Temp = {'Task_1'}>}[Date Created]) >=  MakeDate(2018,1,15)"}>

*$<[SR No]-={"''"}>

*$<[Gate]={"Gate C"}>

}(Gate))-count([SR No]))>0,

(Count({$<[SR No]={"=Min ({<Temp = {'Task_1'}>}[Date Created]) >=  MakeDate(2018,1,15)"}>

*$<[SR No]-={"''"}>

*$<[Gate]={"Gate C"}>

}(Gate))-count([SR No])),

'No repetition')

kpi.PNG

tablekpi.PNG

agigliotti
Honored Contributor II

Re: How can I display result which is greater than 0?

i think you'll need an aggr function to achieve it.

OmarBenSalem
Esteemed Contributor

Re: How can I display result which is greater than 0?

change your expression

from;

YourMeasure

to:

if (YourMeasure>0, YourMeasure, 0)

and under add-on, uncheck : show zro values.

OmarBenSalem
Esteemed Contributor

Re: How can I display result which is greater than 0?

in a KPI, try sthing like:

sum({<Yourdim={"=sum(YourMeasure)>0"}>}YourMeasure)

stuhico09
Contributor

Re: How can I display result which is greater than 0?

Dear All,

Correct answer as below. Thanks.

sum(Aggr(



if(


(Count({$<[SR No]={"=Min ({<Temp = {'Task_1'}>}[Date Created]) >=  MakeDate(2018,1,15)"}>


*$<[SR No]-={"''"}>


*$<[Gate]={"Gate C"}>



}(Gate))-count([SR No]))>0,




(Count({$<[SR No]={"=Min ({<Temp = {'Task_1'}>}[Date Created]) >=  MakeDate(2018,1,15)"}>


*$<[SR No]-={"''"}>


*$<[Gate]={"Gate C"}>



}(Gate))-count([SR No])),




'No repetition') , [SR No]))


ssd.PNG

Community Browser