Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting image on certain condition

Hi Experts..

I want to set the image which should be change based on certain condition..

I  have calculated growth in my application and when growth is greater than 0 then it should display upword Arrow image and

if growth is less than 0 it should display downward Arrow image.

How should i do this?

My expression is:

=If(Num(((MTDGrowth-PreviousMTDGrowth)/PreviousMTDGrowth),'#,#00%')>=0,'qmem://<bundled>/BuiltIn/arrow_n_g.png','qmem://<bundled>/BuiltIn/arrow_s_r.png')

I have tried this expression but im not able to get image it returns the string in 'if' condition that  i have wrote..

Plzz help me

Thanks in advance.

1 Solution

Accepted Solutions
awhitfield
Partner - Champion
Partner - Champion

Set it here instead and you get:

HTH Andy

View solution in original post

10 Replies
preminqlik
Specialist II
Specialist II

go to chart properties >> Expressions tab >>> select expression >> and in display options >> select representation as "Image"

PrashantSangle

Hi,

Your expression looks ok for me.

Can you post screen shot of it.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sushil353
Master II
Master II

Hi,

Try below code:

=If(((MTDGrowth-PreviousMTDGrowth)/PreviousMTDGrowth>=0,'qmem://<bundled>/BuiltIn/arrow_n_g.png','qmem://<bundled>/BuiltIn/arrow_s_r.png')

HTH

Sushil

satishkurra
Specialist II
Specialist II

Hi

Please use the below code in Expressions Tab of chart

Num(Sum(Sales)/Sum(Target)-1, '▲ 0.0%;▼ 0.0%')

Also write the below code for Back  Ground color as

If(Sum(Sales) > 0, '▲ 0.0%;▼ 0.0%')

Thanks

Satish

Not applicable
Author

Thanks satish

But instead of that arrow which you have placed in expression i want image  ..

if growth >0 it should be green upword arrow else red downward arrow image..

awhitfield
Partner - Champion
Partner - Champion

HI,

if the image path etc is displaying as text, then change the representation to IMAGE on the EXPRESSI)N tab:

HTH

Andy

Not applicable
Author

But i want to display in text object only.

awhitfield
Partner - Champion
Partner - Champion

Set it here instead and you get:

HTH Andy

Not applicable
Author

Thank you.. its working