COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: mgregory24479 on 23 Mar 2020 10:42:12 AM

Title: Previous Day Filter
Post by: mgregory24479 on 23 Mar 2020 10:42:12 AM
I have a report that I need to show all transactions for the previous day but I need to factor in the weekends. So I run it today, I want it to show Friday's data but tomorrow I want to show todays. I know I need to create a filter that looks at day of week and then create a between, but I am lost. Any help is appreciated.
Title: Re: Previous Day Filter
Post by: mgregory24479 on 23 Mar 2020 11:56:00 AM
Found the resolution

(_day_of_week(current_date,1) = 1 and [Date] = _add_days(current_date,-3)) or (_day_of_week(current_date,1) =2 and [Date] between _add_days(current_date, -3) and _add_days(current_date, -1)) or [Date] = _add_days(current_date,-1)