COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: v2k4u on 17 Jun 2013 10:36:57 AM

Title: How to create a filter for Current_Date-1
Post by: v2k4u on 17 Jun 2013 10:36:57 AM
i have a requirement for displaying the data for Current_Date-1 and when i try to create a filter using _add_days(current_date,-1) it is not working. Can somebody help me with it....
Title: Re: How to create a filter for Current_Date-1
Post by: bpothier on 17 Jun 2013 11:55:45 AM
Hi there,

You have to specify the field that you want the previous days data for as well.

here is a filter I have for a previous days report where [Prev Bus Day] is the field I want the previous days date calculated on

Hope this helps

[Presentation Layer].[Dials & TalkTime].[Date] = _add_days(current_date, [Prev Bus Day])
Title: Re: How to create a filter for Current_Date-1
Post by: bpothier on 17 Jun 2013 11:57:51 AM
sorry - and my previous bus day calculation is like this

If([current_day_of_week]=1)
then (-3)
else (-1)

so basically if the current day is monday go back 3 days to get fridays data else just got back 1 day to get the previous business day