COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: qvixote on 28 Apr 2015 10:08:40 AM

Title: Traffic-light-like indicator inside crosstable
Post by: qvixote on 28 Apr 2015 10:08:40 AM
Hello!

A client asked me if there's a way of putting a traffic-light-like indicator as a column in a crosstable. It means he wants a column with a green spot if the value of another column is greater than X, and a red spot if not.

Is there a way to do something like that?
Title: Re: Traffic-light-like indicator inside crosstable
Post by: CognosAnalytics on 28 Apr 2015 12:42:26 PM
Hello qvixote,
Yes you can do this. Drag and drop a crosstab space column with fact cells into your crosstab and then click on the intersection(measure) section for this column. Click on it and change the property for "Define contents" to yes. Then drag and drop your image(red,green,yellow traffic lights) and then conditionally show/hide/render based on the value of a measure intersection, which would go into your conditional variable's expression.

-Cognos810
Title: Re: Traffic-light-like indicator inside crosstable
Post by: qvixote on 28 Apr 2015 03:38:56 PM
Thanks for your help, Cognos810!

I did what you propose, bu I'm failing in determine the proper wey to show/hide the images based on the value of the measure. I tried with "display variable" propertie, creating a boolean variable defined like this:

[Query1].[Cobertura] > 0,5

Where "Cobertura" is the measure I have to use, it's evaluating as false all the time.
Title: Re: Traffic-light-like indicator inside crosstable
Post by: CognosAnalytics on 28 Apr 2015 03:54:35 PM
I did a mock up real quick, before I had responded to your message. Did not use display variable, but used render variable instead after inserting multiple images in the same intersection and it worked. Do you have any columns on the crosstab? Can you please attached your report xml here?
Title: Re: Traffic-light-like indicator inside crosstable
Post by: qvixote on 29 Apr 2015 08:19:45 AM
Thanks again, Cognos810!

Here's atrached the xml of my report. I think I've used render variable too, but I'm not sure because I use report studio in spanish, so the property is called "Representar variable". I've tried, as I said before, with render variable, creating a boolean variable but it didn't work.
Title: Re: Traffic-light-like indicator inside crosstable
Post by: CognosAnalytics on 29 Apr 2015 05:47:08 PM
Hi qvixote,
I see that the report variable has 0,2 instead of 0.2
Also, do not see any images in your crosstab and the rendering implementation of the same.

-Cognos810
Title: Re: Traffic-light-like indicator inside crosstable
Post by: Michael75 on 30 Apr 2015 02:32:15 AM
Hi qvixote,

Here's a short tutorial from YouTube which shows:
- conditional formatting of a measure in a crosstab
- conditional display of an image

https://www.youtube.com/watch?v=XutvYaoiXnc (https://www.youtube.com/watch?v=XutvYaoiXnc)

It's not exactly what you are trying to achieve, but you should be able to combine the techniques shown here.

@ Cognos810 It's quite likely that qvixote has a comma defined as Decimal symbol in regional settings.
Title: Re: Traffic-light-like indicator inside crosstable
Post by: qvixote on 07 May 2015 09:06:00 AM
Thanks a lot!

I'll try the last 2 recomendations and tell if it worked.
Title: Re: Traffic-light-like indicator inside crosstable
Post by: qvixote on 07 May 2015 02:39:41 PM
Cognos810, as Michael75 said, I have comma defined as decimal symbol, because that's the regional setting in my country.

I've tried it again, now nos using decimal values, so I redefined the variable to:

[Consulta1].[Cobertura] < 1

and set one image to display when true and another to display when false. The second image is always shown, so I think the variable is always evaluating as false.

Attaches is the report with the modifications.