Author Topic: displaying a report conditionally using a calculation based on parameters  (Read 1077 times)

Offline shahrukhs_fan

  • Associate
  • **
  • Posts: 3
  • Forum Citizenship: +0/-0
Hi Guys.
            I've got a question.  How do you display a report conditionally using a calculation based on parameters.
I've got this report wherein i've created parameters for start date and end date.  I have to display the report if the date range is <= 2 years.  I've hardcoded the dates to use  the first of the month for the start dates and the last of the month for the end date in static choices. i.e, when executed the report will display JAN-05 for the start date, but will actually use 2005-01-01 and JULY-2006 for 2006-07-31 resp.(say)
I created a data item for calculating the date range, namely, date_range as _months_between(?start_date?,?end_date?)
I write the expression in the conditional explorer as [date_range]<=24  and applied it conditionally to display 'Date range out of scope'  or to display the report accordingly.
However, it's not working and the report is showing 'Date ranger out of scope' for all date ranges.
I tried expressions parameterdisplayvalue("date_range")<='24' and parametervalue("date_range")<='24' but that isn't working either.  Can you please help me with this.
Thanks in advance.


Offline Boris-A

  • Full Member
  • ***
  • Posts: 43
  • Forum Citizenship: +2/-0
This should work.  There might be something wrong with your expression... And report Studio will not tell you there is an expression error in the conditions (only in Cognos 8)..

Try the other way around, see if it happens again, if so, your expression is wrong.

Need more clarification ?
________________
Boris

Offline bdybldr

  • Global Moderator
  • Statesman
  • *****
  • Posts: 275
  • Forum Citizenship: +7/-1
I was determined to help you solve this issue but nothing I've tried has solved it.  I get the same results you are.  Must be a bug.  If you find a solution or a work-around, please post it so we can all benefit.  Thanks.