COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS PowerPlay => Topic started by: Endur on 01 Apr 2009 10:58:58 AM

Title: Report expression: date item and text concatenation
Post by: Endur on 01 Apr 2009 10:58:58 AM
Hi ya'll. I'm trying to change the list header. Instead of showing "PnL Today", I want to change it to
show "PnL 4/1/2009". So I need to concatenate the text PnL and a date variable or data item.

Big thanks.
Title: Re: Report expression: date item and text concatenation
Post by: vij on 02 Apr 2009 05:37:59 AM

Hi Endur ,

create the data items as given below....
1) year=extract(year,current_date)
2) month=case extract   (MONTH,current_date)
when 1 then 'Jan'
when 2 then 'Feb'
when 3 then 'Mar'
when 4 then 'Apr'
when 5 then 'May'
when 6 then 'Jun'
when 7 then 'Jul'
when 8 then 'Aug'
when 9 then 'Sep'
when 10 then 'Oct'
when 11 then 'Nov'
when 12 then 'Dec'
end

3) day = extract(day,current_date)

4)cast = cast([year],varchar(5))||'-'||cast([month],varchar(3))||'-'||cast([day],varchar(5))||'  PnL'

use the last cast data item in your report header .it works.


hope it could help you

vij
:)