Discussion Board for collaboration on QlikView Layout & Visualizations.
I'd like to avoid re-writing an expression as part of the background color statement for said expression.
Expression = Sum(A)/Sum(B)
Background Color = if( Value_of_Expression > A, Green(),
if( Value_of_Expression > B, Yellow(), Red() ) )
Replacing "Value_of_Expression" with the actual expression works, but it's difficult to maintend for complicated expressions.
Do alternative methods exist?
I am not sure if you can do that directly.
However, you can use a variable to store the expression and the condition to display the color and then call this variable in the background color property.
Hope that helps.
Try something like this:
where [Expression] is the label of the expresssion you are writing.
Please find the attachment.
define a variable with parameters
ColorCondition = if( $1 > $2, Green(), if( $1 > $3, Yellow(), Red() ) )
and define your expressions as variables
Share = Sum(A)/Sum(B)
and then use
$(ColorCondition($(Share), A, B))
as the expression for your color.
You can refer directly to the name of the expression.
eg. Your expression is:
The expression name is:
A div B
In the background colour expression box you put:
If([A div B] > A, Green(),
If([A div B] > B, Yellow(), Red()))