COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: swarupa on 28 Dec 2015 02:35:03 AM

Title: How to get latest 9 months data from cognos Report
Post by: swarupa on 28 Dec 2015 02:35:03 AM
My Requirement is that when cognos report runs, it should pull always latest 9 months data depends on run time/date.
Can i get logic for this please ...
Title: Re: How to get latest 9 months data from cognos Report
Post by: cvamarley on 28 Dec 2015 03:06:20 AM
If I understand it correctly, Just adding the filter in your query like -

[date] between _add_months(current_date,-9) and current_date

should help !
Title: Re: How to get latest 9 months data from cognos Report
Post by: swarupa on 30 Dec 2015 05:24:30 AM
Thanks for your reply. And It should pull for last 9 months from previous business day...How to find out previous business day from current date logic....
Title: Re: How to get latest 9 months data from cognos Report
Post by: Mohanakrishnak on 30 Dec 2015 07:46:43 AM
you could use _day_of_week (current_date,1) function to find holiday.. I am sure that date dimension in your warehouse will have some indicators to find the Business working day or not..
Title: Re: How to get latest 9 months data from cognos Report
Post by: swarupa on 06 Jan 2016 04:40:45 AM
Yes i have indicator Prev_Buss_DT in one of the tables.
So need to pull data for last 9 months from previous business day.
Can you please provide exact logic ..