Showing results for 
Search instead for 
Did you mean: 

Displays previous week data

Former Member
0 Kudos

Hello Experts,

I have one small requirement. I need your suggestions how to do. Please suggest me how to do. Kindly share me your valuable suggestions.

Based on the prompt selection of user it need to displays the previous week data, current month data, current quarter data, current year data.

For ex: If i select today's date(24/08/2015), It need to displays the previous week(34 th week of this year) data, Current month(August) data from

1/8/2015 to 24/8/2015), Current quarter(August) data from July to 24/8/2015, Current year(2015) data from jan 2015 to 24/8/2015.

I need to do all calculations in the webi report. Suggest me how to do.



Accepted Solutions (0)

Answers (2)

Answers (2)

Active Contributor
0 Kudos


Try with these variables.

End date=userresponse("Enter End date")

make sure datatype of End date is Date.

Current Week=Week([End date])

Previous Week=[Current Week]-1

Week=Week([Calendar Date])

You will get the all week numbers with above variable.

First day of Current Month=RelativeDate(RelativeDate([End date];-DayNumberOfMonth([End date]));1)

Quarter=Quarter([Calendar Date])

You will get the all  Quarter numbers.

Current Quarter=Max([Quarter]) In Report

Year=Year([Calendar Date])

You will get the  Year from this.

Current Year=Year([End date])

Now if you  are using different tables for current month,week then create below variables and then apply table level filters.

V Pre Week=If([Week]=[Previous Week]) Then "Show" Else "Hide"

Apply the table filter on the table and select values equal to Show.You will get the previous week data in the table.

Similar create variables for current month,Year,Quarter and restrict the data in the table.


Former Member
0 Kudos

Thanks for your reply amit,

I tried at report level, but i didn't get it.  I have created filters in universe. now it is working fine.



Former Member
0 Kudos

I have done this requirement earlier,ensure you create a dynamic filter condition in universe such that it points to greater than or equal to start date of current financial year i:e >=1-Apr-FY/1-Jan-Year,

Then create four sub-reports on previous week data, current month data, current quarter data, current year data.,by applying requiste web-i functions.