If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Filter Report Date for Previous Week

Started by t0mato, 09 Sep 2021 03:20:10 PM

Previous topic - Next topic

t0mato

Hi,

I'm working on a scheduled weekly report. It is to be distributed each Monday for the previous week's data (Mon - Sunday). I.e. if i'm sending the report on Monday, 9/13, the date range would need to be for Mon 9/6 through Sunday 9/12.

If [Date] is my data item to filter, how would one write this query? I have a general idea using _add_days and _day_of_week and current_date but am unsure exactly how to piece them together to achieve this.

Thanks!

t0mato

Quote from: t0mato on 09 Sep 2021 03:20:10 PM
Hi,

I'm working on a scheduled weekly report. It is to be distributed each Monday for the previous week's data (Mon - Sunday). I.e. if i'm sending the report on Monday, 9/13, the date range would need to be for Mon 9/6 through Sunday 9/12.

If [Date] is my data item to filter, how would one write this query? I have a general idea using _add_days and _day_of_week and current_date but am unsure exactly how to piece them together to achieve this.

Thanks!

I've found a solution!

[Date] between
_add_days (current_date,-7)
and
_add_days(current_date,-1)