COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: pooja on 26 Mar 2012 02:46:40 PM

Title: date format
Post by: pooja on 26 Mar 2012 02:46:40 PM
hi,

How to display members time dimension like 2011/Dec as 12/2011 in report page?

thanks in advance,

P
Title: Re: date format
Post by: Gyana on 27 Mar 2012 12:31:22 AM
Create a Data Item with Case statement

Case When 'Dec' Then 12
when 'Jan' Then 01
Like 12 months.

Then Create one more data item Extract Year form your Date_DataItem
Then concatenate both Data item into one Data Iten & Use it.
Title: Re: date format
Post by: pooja on 27 Mar 2012 09:46:46 AM
sorry,

can you please tell little more in details..!!

i did not get clearly.

thanks again


P
Title: Re: date format
Post by: Arsenal on 27 Mar 2012 02:23:51 PM
Is this a powercube based report?

else why not just try the data format property and set it to Short for Date Style, order as month, day,year and set display day to No
Title: Re: date format
Post by: Gyana on 27 Mar 2012 11:49:59 PM
Create a Query Item Q1 in Expression Write below :
Case (Substring(Cast(Time_dimension,Char(4))6,5)
When 'Jan' then '01'
When 'Feb' then '02'
When 'Mar' then '03'
When 'Apr' then '04'
When 'May' then '05'
When 'Jun' Then  '06'
.............
...
When 'Dec' then '12'
End

Create Another Query Item Q2 in Expression
Substring(Cast(Time_dimension,Char(4))1,4)

Then concatenate these two Query Item into one---Q3-----Expression

Q1||'/'||Q2

Then Use Date Item Value Time_Dimension But in Display Value (in Property Panel) Use the new item Q3
Title: Re: date format
Post by: wyconian on 28 Mar 2012 02:30:24 AM
These are all good ideas but possibly the best option is to have the date in this format added to your data dimension, if you have access to the ETL or can request a change.

The other options, apart from the short date format, will have an impact on report performance
Title: Re: date format
Post by: pooja on 28 Mar 2012 06:38:44 AM
Yes, this a cube based report.
Title: Re: date format
Post by: Arsenal on 28 Mar 2012 10:52:32 AM
in my experience with cube based reports, unless the date format is set on the time dimension itself, it somehow simply refuses to work on RS.

the best way out is to set the format on the dimension. You can right click the level of the dimension (guess it should be Months in your case)>properties>time
Title: Re: date format
Post by: MFGF on 29 Mar 2012 10:27:26 AM
Yep - I agree with Arsenal. Case statements and the like are relational constructs, and you are using a dimensional source (cube) so you will struggle. Your best bet is to modify the cube as Arsenal suggests.

Regards,

MF.