COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: silywiwi on 30 Aug 2007 02:35:24 AM

Title: the variables doesn't work
Post by: silywiwi on 30 Aug 2007 02:35:24 AM
   hi ,all
   I have a requirement to highlight some field value by variables
I create a variable named "level" ,its Expression is:
      if([score]>90)
          then ('high')
     else
          then ('low')
  and i add two values for level,one is 'high' ,another is 'low'
  In crossTab ,I set the conditional style property of the measure field  to level  variable,when the value is 'high' ,the background color of measure is green,when the value is 'low ',the background  color of is red.
I validated the Expresstion and report,they both have no errors
but  it doesn't work ? can anybody tell me why?

thanks in advance!
Title: Re: the variables doesn't work
Post by: manishtirpude on 30 Aug 2007 03:12:42 AM
Hi,
Below attached tutorial will help you regarding conditional variables in reports.Please do it and tell if its successful.I made this tutorial for you.

Regards,
Title: Re: the variables doesn't work
Post by: MFGF on 30 Aug 2007 03:42:50 AM
In ReportNet, there is a 'feature' wherein the validate option for variable expressions will always return "no errors", whatever you code for the expression.

Try changing your expression to be:

if ([score]>90) then ('high') else ('low')

Does this fix your problem?

Regards,

MF.
Title: Re: the variables doesn't work
Post by: silywiwi on 30 Aug 2007 07:57:56 PM
    to manishtirpude:
        thank you very much for your document:)
    to MFGF:
        I used the code you gived me ,but it doesnot work still
        thank you for your enthusiastic help : )
Title: Re: the variables doesn't work
Post by: silywiwi on 30 Aug 2007 08:13:07 PM
  hi,MFGF, your code can work ;)  when I  used your code I forgot to change the field name ,so....  haha
  thank you very much!
Title: Re: the variables doesn't work
Post by: MFGF on 31 Aug 2007 04:19:32 AM
Hi,

at my age, enthusiasm is a dim and distant memory! ;)

Glad you got it sorted in the end.

MF.