COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: laxmanrao83 on 23 Oct 2012 06:43:26 AM

Title: Chart Report-need Year and Quarter Information
Post by: laxmanrao83 on 23 Oct 2012 06:43:26 AM
Hi,

I have date column ,needs to diaplay in chart for all previos years like (2010,2011) should display in yearly
but for currect(latest) Year need to dispaly in quarter level like(2012Q1,2012Q2).


Pleae give response if you any solution

Please refer the attachemnt if you more infoemation

Thanks & Regards,
Laxman
Title: Re: Chart Report-need Year and Quarter Information
Post by: pricter on 23 Oct 2012 06:58:32 AM
Assuming that you r using  a relational pacakage you can create a
data item with the following expression

if ([Sales (query)].[Time].[Year]=2007) then ([Sales (query)].[Time].[Quarter]) else
(cast([Sales (query)].[Time].[Year],varchar(4)))


Replace 2007 with an expression that give the current year
Title: Re: Chart Report-need Year and Quarter Information
Post by: laxmanrao83 on 23 Oct 2012 07:45:04 AM
hi ,

Thanks for reply
i don't have any dataitem for current year.
Title: Re: Chart Report-need Year and Quarter Information
Post by: pricter on 23 Oct 2012 08:22:21 AM
You can use cognos function current_timestamp

If you are using a ms sql server with

year(current_timestamp)

you get the current year.