COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: EArumugam on 25 Aug 2009 07:46:41 AM

Title: report expression
Post by: EArumugam on 25 Aug 2009 07:46:41 AM
Hi ,

in my report i need to display the parameter value in the report.

example
i have 2 prompts...

1. from and to date
2. only year.(2003,2004.....2009)

for example user select option 1. from_Date is Jul 01, 2008 and to_date is Jun 30, 2009

the report will display the value is 2008 in report column

year product sales amount
2008 xxxxx    45     15000
2008 yyyyy   50     22000

if the user select option 2 year will display directly in column.

if not clear please reply back

URGENT....




Title: Re: report expression
Post by: Birdie on 26 Aug 2009 01:34:53 PM
In order to achieve what I think you're looking for, you'll need to utilize the "use" and "Display" prompt options.

For prompt #1, use 1 and Display "Date"

For prompt #2, use 0 and Display "Year"

In your report, create a case statement for the Text Item column headers, that says something like "case when ParamDisplayValue(YourPrompts) = 1 then [YourDateField] else [YourYearField] end

Let me know if you would like more details.

Good luck!