COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cbyrne on 31 Jan 2014 10:55:08 AM

Title: Filtering on Due Date
Post by: cbyrne on 31 Jan 2014 10:55:08 AM
Hello,

Please can some one help with the below logic in my filtering in my list report.  I need to just filter my line in the report to just show 5 days prior to due date, 5 days after due date, 10 days after due date, 17 days after due date and 23 days after due date, however this doesn't seem to be working.

[Due Date]<= _add_days(current_date, 5)
or
[Due Date]> _add_days(current_date,5)
or
[Due Date]> _add_days(current_date, 10)
or
[Due Date]> _add_days(current_date,17)
or
[Due Date]> _add_days(current_date,23)

Many Thanks in advance

Chris
Title: Re: Filtering on Due Date
Post by: MFGF on 03 Feb 2014 07:34:37 AM
Quote from: cbyrne on 31 Jan 2014 10:55:08 AM
Hello,

Please can some one help with the below logic in my filtering in my list report.  I need to just filter my line in the report to just show 5 days prior to due date, 5 days after due date, 10 days after due date, 17 days after due date and 23 days after due date, however this doesn't seem to be working.

[Due Date]<= _add_days(current_date, 5)
or
[Due Date]> _add_days(current_date,5)
or
[Due Date]> _add_days(current_date, 10)
or
[Due Date]> _add_days(current_date,17)
or
[Due Date]> _add_days(current_date,23)

Many Thanks in advance

Chris

Hi,

What does this doesn't seem to be working mean? Does it produce an error? Does it return no rows? Does it return too few rows? Does it return too many rows? If either of the latter, can you explain more?

When you say show 5 days prior to due date, do you mean you want to see all five of those days or just one day which corresponds to a date five days earlier?

Looking at your expression...

[Due Date]<= _add_days(current_date, 5)

This will return all rows from the beginning of time all the way up to five days in the future (based on the current date).

[Due Date]> _add_days(current_date,5)

This will return all rows beyond five days into the future. When combined with the prior filter (using OR) you will get all rows spanning the entire vastness of time

Is this what you want?

How about

[Due Date] = _add_days(current_date, -5)
OR
[Due Date] = _add_days(current_date, 5)
OR
[Due Date] = _add_days(current_date, 10)
OR
[Due Date] = _add_days(current_date, 17)
OR
[Due Date] = _add_days(current_date, 23)

Is this what you wanted?

Cheers!

MF.
Title: Re: Filtering on Due Date
Post by: cbyrne on 04 Feb 2014 04:19:43 AM
Sorry for the late response MF.

Yes what i mean is that it runs however it doesn't pull through all of the data because of my filtering.

Yes i need to see firstly all records that are due to expire 5 days before the due date so we can call all customers and then flag when customers accounts go 5 days over the due date etc.

Thank you for the codeing, i will try it and let you know.

Thanks Again


Chris