Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for
Search instead for
Did you mean:
Partner - Creator

## Hide values that equal zero in a straight table

Hi,

I have a straight table that has several columns with different expressions.

One of the examples is this expression:

Count({<Month={\$(vMonthMinus1)},Year={\$(vYearMonthMinus1)}>}Place)

I want to have a button that says 'hide zeros', then when I press this button, if

Count({<Month={\$(vMonthMinus1)},Year={\$(vYearMonthMinus1)}>}Place) = 0,

I want to hide all zero values in the column in my straight table and show values >0.

Is this possible?

1 Solution

Accepted Solutions
Creator

Hi,

1. Create a variable "vHideZero" and set value as -1

2. Create the button "hide zeros" and add action External -> Set variable as below

variable : vHideZero

Value:     = if(vHideZero= -1,0,1)

3.in chart,  your expression should be

if(Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination) >vHideZero,

Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination) )

4. In Presentation tab, Check the "Supress Missing" and uncheck the "Supress Zero values"

Thanks,

hemanth.

6 Replies
MVP

May be this:

If(vVar = 0, Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination),

If(Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination) > 0, Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination)))

Where vVar (If(vVar = 1, 0, 1)) will be controlled with the button. When it is 0, everything will be showed, when it is 1, you won't see 0s.

MVP

If you want to hide the lines where

Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination) = 0

you can enable 'suppress zero values' on presentation tab.

This will hide the lines where all expression columns are zero.

So every other expression needs to check your condition, too:

If(  "ExpressionLabelWithZeros" <> 0, OtherExpression, 0)

Normally this - result of 0 - would be hide per default (option within the tab presentation) but if you have further expressions which have a value for this row the row remained visible. Then you would need to implement such condition for each expression, like this (generic approach):

if('\$(var)' = 'hidden', if(count(value)>0, ExpressionForThisColumn, Null()), ExpressionForThisColumn)

// the value for var will be changed per button

Maybe an alternatively could be to use several objects within a container and the user could switch which view he/she want to see.

- Marcus

Creator

Hi,

1. Create a variable "vHideZero" and set value as -1

2. Create the button "hide zeros" and add action External -> Set variable as below

variable : vHideZero

Value:     = if(vHideZero= -1,0,1)

3.in chart,  your expression should be

if(Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination) >vHideZero,

Count({<TradeMonth={\$(vMonthMinus1)},TradeYear={\$(vYearMonthMinus1)}>}Destination) )

4. In Presentation tab, Check the "Supress Missing" and uncheck the "Supress Zero values"

Thanks,

hemanth.

Creator

As you are having scenario where there are multiple expressions, enabling suppress zero values option on all expressions will only supress rows when complete row is calculated to zero.

With button you should be able to achieve this using variable as suggested above.

Partner - Creator
Author

Thank you so much!

Community Browser