COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: xyz on 06 Mar 2015 03:55:58 AM

Title: Solved-How to have a cognos report display data from current date to previous yr
Post by: xyz on 06 Mar 2015 03:55:58 AM
Hi Gurus,

I am using Cognos 10.2.1 and data source is relational, I have a date field from data base and have a requirement to display report from current date to previous year January.

Example:

If my report is running today, then report should have data from today's date i.e. 03/06/2015 to 01/01/2014.

Currently I have a date condition in the filter like below. Which is giving only data for one year from current date to previous year 03/06/2014. How will I get above requirement.

[Date Column] between _add_years(current_date, -1) and current_date.

Can some one please let me know, your help is much appreciated.

Thanks & Regards,
XYZ

How will I get the pr
Title: Re: How to have a cognos report display data from current date to previous year Janu
Post by: BigChris on 06 Mar 2015 04:18:06 AM
how about something like:

[Date Column] between _make_timestamp(year(current_date)-1, 01, 01) and current_date
Title: Re: How to have a cognos report display data from current date to previous year Janu
Post by: xyz on 06 Mar 2015 04:42:23 AM
A big Thanks to you for your quick response Big Chris.

I really appreciate the help.


Thanks & Regards,
XYZ
Title: Re: How to have a cognos report display data from current date to previous year Janu
Post by: BigChris on 06 Mar 2015 05:15:28 AM
You're welcome - did it work?
Title: Re: How to have a cognos report display data from current date to previous year Janu
Post by: xyz on 07 Mar 2015 01:22:27 AM
Yes, it worked.

I forgot to mention that though :)





Thanks & Regards,
XYZ