COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: barrysaab on 29 May 2011 01:32:53 PM

Title: Conditional Formatting
Post by: barrysaab on 29 May 2011 01:32:53 PM
I have to conditional format a crosstab depending upon a revenue, i have string variable
if([Query1].[Revenue])>(1000000) then (' High ') else
if([Query1].[Revenue])<(11000000) then (' Low ')

It is validating fine but report output doesn't show the colors i have applied.
Title: Re: Conditional Formatting
Post by: PRIT AMRIT on 29 May 2011 09:22:52 PM
Quoteif([Query1].[Revenue])>(1000000) then (' High ') else
if([Query1].[Revenue])<(11000000) then (' Low ')

Well, let me take you through a bit before getting into the answer.

As per your PDF output, Mountaineering Equipment -> E-mail is 7,476,451.96, this figure is >1000000 and also <11000000. So both  the conditions are TRUE(high & low), which resulting no conditional coloring.

If you want all the values between 1000000 and 11000000 should show some color and rests a different color, then your expression should look like below

if([Query1].[Revenue] between 100000 and 1100000)
then (' High ')
else (' Low ')

Hope it helps?

Title: Re: Conditional Formatting
Post by: barrysaab on 29 May 2011 11:12:43 PM
Thanks,Prit.But the expression is not validating and giving me parsing error.
Title: Re: Conditional Formatting
Post by: bvk.cognoise on 29 May 2011 11:49:36 PM
Hi barrysaab,

please explain clearly your exact requirement.we can solve it easily. we are not able to understand your requirement.

thanks

bvk
Title: Re: Conditional Formatting
Post by: PRIT AMRIT on 30 May 2011 12:10:22 AM
QuoteBut the expression is not validating and giving me parsing error.

Should work though, anyway have you tried like this?

if([Query1].[Revenue] >= 100000 and [Query1].[Revenue] <=1100000)
then ( 'High')
else ('Low')
Title: Re: Conditional Formatting
Post by: barrysaab on 30 May 2011 11:32:40 AM
Thanks a lot PRIT.It worked!