Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I would like to display different images(Smiley of colours red, orange and green, or blank image) based on the expression value in a straight table. I have an expression labelled KPI_value and based on that value, i need to display the smiley as a second expression displayed as image. I am comparing the KPI_value to 2 target thresholds. In terms of pseudo code, this is what I want to evaluate:
If threshold1 or threshold2 are null
display blank image;
else if KPI_value<= threshold1
display green smiley;
else if threshold1 < KPI_value <= threshold2
display orange smiley;
else if KPI_value > threshold2
display red smiley;
else
display blank image;
I would like to know how to write this if then else as an expression
Thanks in advance
Hasnaa
Try this
if (isNull(threshold1) or isNull(threshold2),blank image,
if(KPI_value<=threshold1,green smiley,
if(KPI_value<=threshold2,orange smiley,
if(KPI_value>threshold2,red smiley,blank image))))
Greetings,
Lucas
If (isnull(threshold1) or isnull(threshold2)
"display blank image",
if (KPI_value<= threshold1,
"display green smiley"
if (threshold1 < KPI_value and KPI_value <= threshold2,
"display orange smiley;",
if( KPI_value > threshold2,
"display red smiley;",
"display blank image;"
)
)
)
)
Hope it helps
Here is the example expression, Hope it helps.
=if([Net Margin] > 0, 'qmem://<bundled>/BuiltIn/smiley3_y.png', if([Net Margin] < 0, 'qmem://<bundled>/BuiltIn/smiley3_r.png',
'qmem://<bundled>/BuiltIn/smiley3.png'))
Hi.
Thanks all. It works
Regards
Hasnaa
Great!
Make sure you mark this discussion as answered though!
Cheers,
Lucas