COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: lorenmario on 26 Jul 2013 10:54:58 AM

Title: Last three months Filter - Help me!
Post by: lorenmario on 26 Jul 2013 10:54:58 AM
Hello!

I am creating a report using a relational database. I need to insert a filter that I will always return the last three months from the current date.

How to do this in Report Studio?
Thank you!!
;)
Title: Re: Last three months Filter - Help me!
Post by: Lynn on 26 Jul 2013 11:16:09 AM
Create a filter with this expression:

[YourQueryItemDate] >= _add_months(current_date, -3)
Title: Re: Last three months Filter - Help me!
Post by: Web2CRM on 29 Jul 2013 01:00:34 AM
Try the expression below in your filter:

[DataItemDate] between _first_of_month( _add_months(current_date, -3) ) and current_date
Title: Re: Last three months Filter - Help me!
Post by: lorenmario on 29 Jul 2013 08:47:00 AM
I will test here, thank you!!