Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how do i exclude a 0 value within set analysis

Hi,

My requirement is as below

I have a date column, when I select a date, from that date I need to consider 52 weeks back and fetch the lowest price .I need to exclude the 0 and display the next lowest value.

DT_KEY Price
31/12/2014 671.65
31/12/2013 200
31/12/2013 0

Here if I select the date as 31/12/2014 ,I need to take 52 weeks prior to that and fetch the lowest price.here the lowest price is 0 but I don't want to fetch 0 instead want to fetch the next lowest price i.e 200.

Below I have the statement to fetch values for minimum value ,but the result is fetching as 0.

=if(price<>0,min({<DT_KEY={">=$(=DT_KEY($(vStart)))<=$(=DT_KEY($(vPrevious)))"}>}price))

Please help me to get the right expression to fetch minimum price excluding 0.

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Like this:

=min({<DT_KEY={">=$(=vStart)<=$(=vPrevious)"}, price-={0}>} price))

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi Jonathan,

Am not getting the result still.i am getting a blank value.

Tried using the below also.but still unable to fetch the minimum value apart from 0.

=min({<DT_KEY={">=$(=vStart)<=$(=vPrevious)"},price={'*'}-{'0'}>} price)

sasikanth
Master
Master

hi try some thing like

min({<DT_KEY={">=$(=vStart)<=$(=vPrevious)"},price={'*'}-{'0'}>}  if( not isnull(price),price)

tobias_klett
Partner - Creator II
Partner - Creator II

Hi,

since the price will not be negative just say ">0" like this:

min({<DT_KEY={">=$(=vStart)<=$(=vPrevious)"},price={">0"}>}  if( not isnull(price),price)


Regards

Tobias