COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Query Studio => Topic started by: MFERNS on 04 Aug 2024 11:49:16 PM

Title: Run report for 15 days in same month but prior year
Post by: MFERNS on 04 Aug 2024 11:49:16 PM
Hi All


I know how to run a report for 15 days of current month in current year but does anyone know how to run a report for the same 15 days of same month in prior year.

Thanks in advance
Title: Re: Run report for 15 days in same month but prior year
Post by: MFGF on 05 Aug 2024 07:18:45 AM
Quote from: MFERNS on 04 Aug 2024 11:49:16 PMHi All


I know how to run a report for 15 days of current month in current year but does anyone know how to run a report for the same 15 days of same month in prior year.

Thanks in advance

I'm assuming you have a filter based on current_date for your report for 15 days of current month in current year? There is an _add_years() function in Cognos that allows you to add or subtract whole years from a date. You could presumably use a similar expression, but based on _add_years(current_date, -1) to get the same period in the prior year? It's difficult to say for sure without knowing what you are doing currently, though.

Cheers!

MF.