Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How to exclude items out of listbox with value 0?

Hi all,

I'm fighting the following problem. I have about 3000 items in my listbox and many of those items give the value 0. What I want to do is to exclude the items which gives y=0. Does someone have an idea how to do this?

Thank you!

8 Replies
Peter_Cammaert
Not applicable

Re: How to exclude items out of listbox with value 0?

What is y? Is it another field in the same table as your items? Is it the result of an aggregation expression?

The more information you supply from the start, the quicker you'll have an answer without successive questions for additional information.

Peter

clondono
Not applicable

Re: How to exclude items out of listbox with value 0?

Hello Jerry,

Maybe you can set a condition on your load statement like:

if(Y=0, Null(), Y)


In a ListBox null values are suppressed automatically.


Thanks,

Carlos

Not applicable

Re: How to exclude items out of listbox with value 0?

Ah yes, well the following:

Screenshot_3.png

As you can see I selected "LaadpaalID" 3454 and "Gebruiker" 13806. With that I get an Y value around 35 kWh. But for some "LaadpaalID" and/or "Gebruiker" the Y value is 0. I want to get those out of my listbox.

And for another example:

Screenshot_5.png

When I select "LaadpaalID" 3540 there is no data to display because nobody uses that one, so I don't need it in the list box and I want it gone.

shaktisinghchau
Not applicable

Re: How to exclude items out of listbox with value 0?

Hi Jerry,

I am assuming Y is another dimension of your table and your displaying X values into Listbox, to remove Y=0 values from list box you need to follow this steps.

List box properties - > Field - > Choose expression - > = If(Y > 0, X )

It will list down only greater than zero values in List box.

Hope this help.

Thanks,

idogridish2
Not applicable

Re: How to exclude items out of listbox with value 0?

Hi Jerry,

you can eather load your data without zero value in this field

e.g

Load

y

From YourTable

Where  y <> 0;

or you can use the expression clondono seggested if(Y=0, Null(), Y) inside of a listbox expression.


Regards.

Peter_Cammaert
Not applicable

Re: How to exclude items out of listbox with value 0?

You can try a listbox with an expression field instead of a regular field (select <Expression> at the bottom of the field selection list):

=Aggr(Only({<LaadpaalID={"=Sum(Verbruik)<>0"}>} LaadpaalID), LaadpaalID)

I used an imaginary field "Verbruik", because I think that "y" is not the real consumption field. Replace with whatever is applicable in your data model.

Best,

Peter

mamthaanand
Not applicable

Re: How to exclude items out of listbox with value 0?

I had a similar requirement and this worked for me .Thank you  @Peter Cammaer

dialika_bantog
Not applicable

Re: How to exclude items out of listbox with value 0?

What if I'm trying to choose between including 0s or nulls or excluding them?