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 Expression to query for last work week

Started by Rosadocc, 24 Sep 2019 09:43:48 AM

Previous topic - Next topic

Rosadocc

Hi. I'm fairly new to developing reports in COGNOS Report Studio and have a question.

What is the best expression to pull a report for the previous work week (Monday thru Friday)?

For example, today is Tuesday and if I run the sales report today, I want it to show all transactions from last Monday thru Friday. The same applies to whatever day I decide to pull the report.

Andrei I

E.g. Filter:

[Date] between
_add_days ( current_date
   , (-1) * ( _day_of_week ( current_date,1)-1 )
)
and
_add_days ( current_date
   , (-1) * ( _day_of_week ( current_date,1)-1 ) +4
)

Rosadocc

Thanks.

I came across another expression that seemed to work for me:

[Date] between
_add_days(current_date, (-1 * _day_of_week(current_date,2)) - 7)
and
_add_days(current_date, (-1 * _day_of_week(current_date,2)) - 3)