If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Using a String in Style variable..

Started by Kevvukeka, 25 Jan 2013 06:19:51 AM

Previous topic - Next topic

Kevvukeka

Hi Everyone,

I have few values in a column. few are equal to 0 and few are greater than 1 and few are negative numbers. I need to color the cells based on the values. for e.g red for -1, blue for 0 and green for greater than 1.
I used the following method
case [variance]
when('<0') then ('Red')
when ('0') then ('Blue')
when('>1') then ('Green')
end.

i selected the string1 in style variable and checked the 'RED' option in conditional explorer tab, selected the Background color as "RED" and run the report. But it shows me "Internal Error". Did I missed anything.

Please help..

Thanks & Regards,

MFGF

What data type is your column? Testing when('<0') will not return a true result unless your item is a character or char and actually contains the value '<0'

Is your item a numeric or a string?

MF.
Meep!

Kevvukeka


MFGF

How about:

CASE  WHEN [variance] < 0 THEN 'Red'
WHEN [variance] = 0 THEN 'Blue'
WHEN [variance] > 1 THEN 'Green'
ELSE 'Other' END
Meep!

Kevvukeka

Hi MF,

I used the expression as below:

case
when ([Query1].[variance])<0 then 'RED'
when([Query1].[variance])>0 then 'BLUE'
when([Query1].[variance])>10 then 'GREEN'
else 'OTHER'
end

selected the variance column.selected the style variable->string1->conditional explorer->selected "Red", gave the background color as "Red". repeated for all 3 colors. every time double clicked the green bar and selected the options but still enitre column takes only one color.

My variance data is as follows:
11.41
6.38
2.09
0.40
2.97.

Thanks

MFGF

Hi,

Your expression will always evaluate to the BLUE condition for the data values you supplied. In my expression I had =0 but in yours you have >0 and all your values are >0. Once a condition evaluates to TRUE no further processing of the expression is done.

You would need to modify your expression as follows:

case
when ([Query1].[variance]<0) then 'RED'
when([Query1].[variance]>=0 and [Query1].[variance] <=10) then 'BLUE'
when([Query1].[variance]>10) then 'GREEN'
else 'OTHER'
end

Meep!

Kevvukeka

Thanks a Lot MF. Thanks for your patience. I got it now..

Regards,
PS

MFGF

Great! Thanks for the update, and you're welcome! :)

MF.
Meep!