COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: rlcaputo on 21 Nov 2005 06:14:07 PM

Title: Week Of Year
Post by: rlcaputo on 21 Nov 2005 06:14:07 PM
Why does my ReportNet return 48 when given

_week_of_year(current_date)

and current date is today, 2005-11-21.

According to function tips this should be week 47 but as stated I get 48 in return. How does it bust up weeks?

Thanks,

Bob
Title: Re: Week Of Year
Post by: zenith on 21 Nov 2005 11:45:31 PM
I did try the same function and it returns me week 47
Had you checked the system date before you ran the report
Maybe that could be the factor
Title: Re: Week Of Year
Post by: rlcaputo on 22 Nov 2005 08:47:25 AM
Yes I have,  _week_of_year(2005-11-21) also returns 48.

And as I mentioned current date was correct.

I have done several test with hardcoded dates for inputs and it seems there is a week 53 last year and no week 1 this year.

??????

Is this settable somewhere in the ReportNet setup?
Title: Re: Week Of Year
Post by: sir_jeroen on 22 Nov 2005 02:28:17 PM
It depends on where you live... USA has other weeknumbering that eg EU
Title: Re: Week Of Year
Post by: rlcaputo on 28 Nov 2005 01:11:43 PM
I am in Wisconsin which last I knew was in US.

Bob
Title: Re: Week Of Year
Post by: sir_jeroen on 30 Nov 2005 04:14:06 AM
Oh... you can't help that.. :P
But if you look in a paper agenda... what does the week# say?
And what's your first day of week?
The week# is calculated according to ISO-8601. Perhaps you should have a look into that standard...
Title: Re: Week Of Year
Post by: rlcaputo on 05 Dec 2005 10:40:13 AM
Yes its probably one of those standards issues. I believe Cognos is returning week-of-year vs fiscal-week. Depending on your definitions that may be two different numbers.

Case closed, thank you,

Bob