COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Prakash Bhai on 19 May 2010 01:28:41 AM

Title: Current Year/Quarter
Post by: Prakash Bhai on 19 May 2010 01:28:41 AM
Hi All.

I am using Relational Model, In that I have Quarter and Year(Both the data types are Int-16 bit and Usage prop is a Fact). And the year has been mentioned as 2,010 (in the package)

                         I need the filtered data on Year and Quarter in Current Year/Quarter Format.

We have used Cast function as ( IF (?Par_Year? = 'Current Year') THEN ([S&R].[defined period].[Year] = cast(year(current_date) as Numeric (4)))

ELSE ([S&R].[defined period].[Year] = ?Par_Year?)

But when  we select Current Year,Current Quarter in the drop down prompt, we are getting Wrong Data.

Regards,

Ram.

Title: Re: Current Year/Quarter
Post by: IceTea on 19 May 2010 02:52:34 AM
1.) a year or a quarter is not a fact... but rather an attribute or identifier
2.) if you compare with an INT, why cast the year(current_date) to Numeric? Cast it to Integer. But however. I wouldn't do any cast in this filter function?! It works perfect to compare  the  [Year] (as you described is INT16) with the year(current_date)-Function. No cast necessary at all.
Title: Re: Current Year/Quarter
Post by: Prakash Bhai on 19 May 2010 05:17:30 AM
Hi,
Thanks for the reply. As per your suggestion I did.But the result is same.Showing Wrong Data.

Might be problem with Data coming from the package, I guess

Regards,

Ram
Title: Re: Current Year/Quarter
Post by: tupac_rd on 19 May 2010 01:30:17 PM
so is 'Current Year' a static choice, in that case is the use value and display value both 'Current Year'