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: 
Anonymous
Not applicable

Suppress 0 values in listbox

I have a listbox which displays count of products for each line. I want to suppress the line which contain 0.

I am using the following formula to generate the count:

count({$ <

[Financial Year] = {2014},

[Financial Period] = {1,2}

>}[Product num])

+

count({$ <

[Financial Year] = {2013},

[Financial Period] = {11,12}

>}[Product num])

It generates the list as expected but I just want to suppress the 0 values How do I suppress the 0 values in listbox?

Thank you in advance.

1 Solution

Accepted Solutions
rubenmarin

Hi Ranajit, maybe using a calculated expression, in the list box preoperties, instead of selecting the field, go to the bottom of that list and select <Expression>, you can use this expression:

Aggr(If(count({$ <[Financial Year] = {2014}, [Financial Period] = {1,2} >}[Product num]) +

  count({$ <[Financial Year] = {2013},[Financial Period] = {11,12}>}[Product num])<>0, [Product num]), [Product num])

Not tested.

View solution in original post

9 Replies
alexandros17
Partner - Champion III
Partner - Champion III

try with:

If(

count({$ <

[Financial Year] = {2014},

[Financial Period] = {1,2}

>}[Product num])

+

count({$ <

[Financial Year] = {2013},

[Financial Period] = {11,12}

>}[Product num])

=0, Null(),

count({$ <

[Financial Year] = {2014},

[Financial Period] = {1,2}

>}[Product num])

+

count({$ <

[Financial Year] = {2013},

[Financial Period] = {11,12}

>}[Product num])

)

let me know

rubenmarin

Hi Ranajit, maybe using a calculated expression, in the list box preoperties, instead of selecting the field, go to the bottom of that list and select <Expression>, you can use this expression:

Aggr(If(count({$ <[Financial Year] = {2014}, [Financial Period] = {1,2} >}[Product num]) +

  count({$ <[Financial Year] = {2013},[Financial Period] = {11,12}>}[Product num])<>0, [Product num]), [Product num])

Not tested.

jonathandienst
Partner - Champion III
Partner - Champion III

No alternative but to calculate the amount twice:

If(Count({<[Financial Year] = {2014}, [Financial Period] = {1,2}>

  + <[Financial Year] = {2013}, [Financial Period] = {11,12}>} [Product num]) <> 0,

Count({<[Financial Year] = {2014}, [Financial Period] = {1,2}>

  + <[Financial Year] = {2013}, [Financial Period] = {11,12}>} [Product num]))

PS I refactored your two terms into a set expression union '+'

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

I tried this before. it does suppress the 0 values but I want it not to show the line represented by the 0 value.

Anonymous
Not applicable
Author

I tried this before as well. It does supress the 0 but I do not want to show the entire line represented by the 0 value

Anonymous
Not applicable
Author

I tried it but it did not work. Thanks for your help.

tcullinane
Creator II
Creator II

if you have multiple expressions you will need the if statement containing the calculation of the condition in each, else they will continue to force a blank cell.

alexandros17
Partner - Champion III
Partner - Champion III

please share your qvw

Anonymous
Not applicable
Author

I can't share the QVW, its for work. I'll make a qvw and upload it.