COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: madhancognos on 20 Feb 2014 09:33:30 AM

Title: Need to extract current month,current date in relational model
Post by: madhancognos on 20 Feb 2014 09:33:30 AM
Hi Gurus,
   I have only start time and end time as Time stamp in my query subjects.
   I dont have any year column,month column and date column in my query subject.
   So i derived the year,month using extract function and saved as calculated column in FM and for Date i used current_date.
   Now i am creating a chart in the R.S ,there i need some filters like current_month,Current_date,Current Year.
   Can anyone suggest how to get it in filter.
  My database is oracle
  Relational datbase
  Cognos 10.2.1 version.

Thanks in advance
K.M

Title: Re: Need to extract current month,current date in relational model
Post by: MFGF on 20 Feb 2014 09:53:55 AM
Hi,

So your query subject now has these derived items available?

For current year wouldn't it be [Your derived year item] = extract(year,current_date)

Similarly [Your derived month item] = extract(month,current_date)

Or am I missing something?

MF.