COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: cognos05 on 18 Dec 2018 03:40:58 PM

Title: Showing images based on a condition
Post by: cognos05 on 18 Dec 2018 03:40:58 PM
Hi Guys,

I wanted to show an image based on the growth value .

if([Growth %]>=0.2)
Then ('../samples/images/icon_metric_trend_up.gif'))


But I am not able to get the image showing .

it just displays the text ../samples/images/icon_metric_trend_up.gif.

Is this the right approach .
Title: Re: Showing images based on a condition
Post by: dougp on 18 Dec 2018 03:56:34 PM
That's the output I would expect from that expression.

Try an HTML item and put HTML in it.

if (<condition>)
then ('<img src="/folder/image.gif" />')
Title: Re: Showing images based on a condition
Post by: cognos05 on 18 Dec 2018 04:24:15 PM
so i wanted to show the trend icon next to growth . so unlocked the cell and a brought a data item next to growth and specified the image .

How should I do that with html item.

Should I go for conditional formatting .

Title: Re: Showing images based on a condition
Post by: CognosPaul on 18 Dec 2018 06:00:35 PM
Use an image item, and use that expression as the URL source.
Title: Re: Showing images based on a condition
Post by: cognos05 on 19 Dec 2018 07:26:46 AM
should define the image location in the dataitem. Got it thanks !!