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

Previous Week

Started by opeshow, 22 Dec 2006 06:28:47 PM

Previous topic - Next topic

opeshow

I am new to Report Studio.

Tyring to get information for the previous week of the calendar year.  I tried filtering with the following ...

_week_of_year(date_entered) = _week_of_year(getdate())

Whenever I try this I get an error around the '+', the first half without the comparison works fine but as soon as I try to constrain it I get errors.  Anyone know why this doesn't work?  Is there something I am doing wrong or perhaps there is a better way to determine if something was entered in the last calendar week.

coledog

I dont know if this will help you and it's not the same thing you are asking for. I used this to get the same wtd last year in my report. I am using mssql 2000 database remember this is week to date

([ImportView].[TransDaily_Reporting].[Tr_Date]>= _add_days(_add_years(?Date?,-1),(_day_of_week(_add_years(?Date?,-1),7)-1)* -1)  and [ImportView].[TransDaily_Reporting].[Tr_Date]<= _add_years(_add_days(?Date?,1),-1))

I had to offset a day for prior year and the week run from sunday to saturday there is a problem with leap year

sir_jeroen

Why don't you add a time dimension (Table with year,quarter, month,date, flag) with flags set to current week, previous week etc.... (1=current week, 2= prev week etc..)
Most easiest solution. Even with leap years.

coledog

#3
I like you answer to this problem. I have a question of you how do you handle the join in FM The time dimension table  is joined to what and how is it joined