Is this correct in getting ISO Year like this??

Hi All,
ISO week we have in webi but then year again as calendar.
Any way i’ve been thinking that if the iso week is 1 there might be days from last year in it, but they would be daynumbers greater than 350 so that gives me the trigger to add 1 to year(…).
The same when the year is week 52 or 53, days from next year could be added but then day number is less then 30 an you can substract a year.
Otherwise, hurray years are the same, ISO or calendar.

Am i thinking correctly or missing something …
Thanks for checking, code is:

=if (week([DATE])=1 and DayNumberOfYear([DATE])>350) then (Year([DATE])+1)
else if (week([DATE])>51 and DayNumberOfYear([DATE])<30) then (Year([DATE])-1)
else Year([DATE])


IngeH :netherlands: (BOB member since 2004-06-22)

ISO Year is not the same as Calendar year.
ISO years are either 52 or 53 weeks long, so 364 or 371 days. The first week of an ISO year is the week that contains the first Thursday of the year. It always contains January 4th.

Indeed, thats why i want to get this some how, so that i have ISOYear, which is not in webi, to combine with ISO Week, which is in webi.

Examples
ISO Week 1 of this year has 31st Dec of 2012 in it, ISO Year 2013 against Cal 2012
ISO week 52 of 2010 also has jan 1st 2011 in it, ISO Year 2010 against Cal 2011
I want 201301 for 31st dec 2012
And 201052 for 1st Jan 2011

The comparisons wiht the days i used in the formula i have over estimated and could indeed be smaller but will this function give me my ISO year.
And if not how then???

Thanks all,


IngeH :netherlands: (BOB member since 2004-06-22)