COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: matrixfree on 21 Apr 2016 09:38:43 AM

Title: Filtet DateBirth due in 5 days
Post by: matrixfree on 21 Apr 2016 09:38:43 AM
Hello to all,

We have this report that has besides many columns in a LIST report, a specific column that had the DateOfBirth of the employees.

We want to filter this LIST report in order to only display the employees that Date of Brith is 5 days from now.

Is that possible and how ?

Thanks !
Title: Re: Filtet DateBirth due in 5 days
Post by: BigChris on 21 Apr 2016 10:12:57 AM
Cognos is good, but how is it going to forecast those employees that are going to be born in 5 days time?!?  ;)

Assuming you mean those people who will have their birthdays in the next 5 days...I'd think you 'd want something like:

_make_timestamp(year(current_date),month(DateOfBirth), day(DateOfBirth) = _add_days(current_date,5)

Obviously you'd need to tweak that for the 5 days from the 26th of December, but I'm sure you can sort that out.
Title: Re: Filtet DateBirth due in 5 days
Post by: matrixfree on 21 Apr 2016 08:26:57 PM
Lol good one.... ;D

Thanks by the way I will test all that and see how it goes.
Title: Re: Filtet DateBirth due in 5 days
Post by: Lynn on 22 Apr 2016 02:37:31 AM
Excellent answer Chris. I think the tweak you mentioned would just be extracting the year after adding 5 days to current date.


_make_timestamp(year(_add_days(current_date,5)),month(DateOfBirth), day(DateOfBirth) = _add_days(current_date,5)
Title: Re: Filtet DateBirth due in 5 days
Post by: BigChris on 22 Apr 2016 03:01:26 AM
Yes, good shout Lynn...that ought to do it.