Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
ranajit81
New Contributor III

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
Highlighted

Re: Suppress 0 values in listbox

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
Highlighted

Re: Suppress 0 values in listbox

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

Highlighted

Re: Suppress 0 values in listbox

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

Highlighted
MVP
MVP

Re: Suppress 0 values in listbox

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
Highlighted
ranajit81
New Contributor III

Re: Suppress 0 values in listbox

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

Highlighted
ranajit81
New Contributor III

Re: Suppress 0 values in listbox

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

Highlighted
ranajit81
New Contributor III

Re: Suppress 0 values in listbox

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

Highlighted
tcullinane
Contributor II

Re: Suppress 0 values in listbox

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.

Highlighted

Re: Suppress 0 values in listbox

please share your qvw

Highlighted
ranajit81
New Contributor III

Re: Suppress 0 values in listbox

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