Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Button Action to show only selected Color Limit Expressions

I have a calculation saved in a variable. I am using the same in my expression 

if($(vFormula)<5, $(vFormula))

 

The expression column shows numbers less than 5 but also shows empty rows for the dimension. I checked Suppress Zero-Values for the expression and Suppress when value is null for the dimension. It still does not work.

How to remove the empty rows for this expression?

Labels (2)
1 Solution

Accepted Solutions
edwin
Master II
Master II

if the dimension results in a value for your other expression then the row becomes valid and you WILL get the null under the <5 column.  setting suppress missing will not do anything as that other column is valid.  you need to decide what you want to do for this scenario, if you dont care about that other expression then you can (and this without seeing the complete picture) add an if statement in the other expression 

=if(sum(amount)>0, YOUR EXPRESSION HERE)

this will basically null your other expression if the sum is 0


View solution in original post

5 Replies
edwin
Master II
Master II

a simple approach:
create 3 expressions:
=if(sum(amount)<5,sum(amount))
=if(sum(amount)>=5 and sum(amount)<10, sum(amount))
=if(sum(amount)>10,sum(amount))

all of them would have the same text color expression :
=if(sum(amount)<5, red(),
if(sum(amount)<10, green(), yellow()
)
)

this will show all 3 expressions but some will be null depending on the total,  then create a button that will either select a field (with colors) or 3 buttons that set a color variable.
then in each express add a condition to show the expression is field is selected or a variable is set

qlikwiz123
Creator III
Creator III
Author

@edwin 

The expression column shows numbers less than 5 etc based on the conditions but it also shows empty rows for the dimension. I checked Suppress Zero-Values for the expression and Suppress when value is null for the dimension. It still does not work.

 

qlikwiz123_0-1601322858911.png

 

edwin
Master II
Master II

the expression 
=if(sum(amount)<5,sum(amount))
will result in 0 if amount is null.  suppressing 0 removes it.  is it possible you have other expressions that influence the visualization?  add a QVW so its easier to check

qlikwiz123
Creator III
Creator III
Author

I have other expressions in the same table. Guess they are affecting this logic. I need those expressions and this conditional ones as well. 

edwin
Master II
Master II

if the dimension results in a value for your other expression then the row becomes valid and you WILL get the null under the <5 column.  setting suppress missing will not do anything as that other column is valid.  you need to decide what you want to do for this scenario, if you dont care about that other expression then you can (and this without seeing the complete picture) add an if statement in the other expression 

=if(sum(amount)>0, YOUR EXPRESSION HERE)

this will basically null your other expression if the sum is 0