dbTalk Databases Forums  

SQLl2005 time dimension acting strange

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss SQLl2005 time dimension acting strange in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
peter walker
 
Posts: n/a

Default SQLl2005 time dimension acting strange - 07-18-2006 , 10:05 AM






Hi, I have migrated a DTS package from SQL 2000 to SQL 2005. When I view the
time dimension within SQL 2005 I get the following:

http://tinyurl.com/hba6p

Why do I get (for example):

year = 2006, month = July 1987, Year = 1 July 2006 ?

I can't quite see why I am getting the year 1987 in the month column. The
month column has incorrect years, it should be:

year = 2006, month = July 2006, Year = 1 July 2006 ?

Any help most appreciated.

Peter



Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: SQLl2005 time dimension acting strange - 07-18-2006 , 12:40 PM






Hi Peter,

Did you try an "Explore Data" browse of the Time dimension table, and
see if the column which provides the name of the month has correct
values for the day rows? It's hard to say what the issue is without
knowing more about the dimension data.


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #3  
Old   
Jéjé
 
Posts: n/a

Default Re: SQLl2005 time dimension acting strange - 07-18-2006 , 04:45 PM



how have you defined your key columns for the month and the day attributes?
(which column(s) are used)
do you use unique keys?
I mean:
200605 = May 2006
20060505 = 5 may 2006

if you only use the month number the result could be like your issue.(the
month number only is not unique inthe hierarchy, may is under every year)

"peter walker" <p.walker (AT) nospam (DOT) com> wrote

Quote:
Hi, I have migrated a DTS package from SQL 2000 to SQL 2005. When I view
the time dimension within SQL 2005 I get the following:

http://tinyurl.com/hba6p

Why do I get (for example):

year = 2006, month = July 1987, Year = 1 July 2006 ?

I can't quite see why I am getting the year 1987 in the month column. The
month column has incorrect years, it should be:

year = 2006, month = July 2006, Year = 1 July 2006 ?

Any help most appreciated.

Peter




Reply With Quote
  #4  
Old   
peter walker
 
Posts: n/a

Default Re: SQLl2005 time dimension acting strange - 07-19-2006 , 10:52 AM



Thanks Deepak and Jeje.

the key to my solution was:

Quote:
200605 = May 2006
20060505 = 5 may 2006
I recreated the time dimension table to have the following structure

<column name>: <sample data>
Year: 1980
Month: January 1980
Day: 1 January 1980
date: 1980-01-01 00:00:00Z
indexDay: 19800101
indexMonth: 198001

'indexDay' is the index for 'Day'. Likewise 'indexMonth' is the index for
'Month'. 'Year' is indexed against itself.

It works nicely now!

I have noticed that Year and Month are using an index of datatype integer.
However Day is using an index of datatype WChar. Shouldnt all indexes be of
type integer?

Cheers,

Peter

Quote:

if you only use the month number the result could be like your issue.(the
month number only is not unique inthe hierarchy, may is under every year)

"peter walker" <p.walker (AT) nospam (DOT) com> wrote in message
news:eoYW9tnqGHA.4032 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
Hi, I have migrated a DTS package from SQL 2000 to SQL 2005. When I view
the time dimension within SQL 2005 I get the following:

http://tinyurl.com/hba6p

Why do I get (for example):

year = 2006, month = July 1987, Year = 1 July 2006 ?

I can't quite see why I am getting the year 1987 in the month column. The
month column has incorrect years, it should be:

year = 2006, month = July 2006, Year = 1 July 2006 ?

Any help most appreciated.

Peter






Reply With Quote
  #5  
Old   
Jéjé
 
Posts: n/a

Default Re: SQLl2005 time dimension acting strange - 07-19-2006 , 11:50 AM



try to change from WChar to integer or bigint

in my case I'm using the date himself for the day key, not an integer.

"peter walker" <p.walker (AT) nospam (DOT) com> wrote

Quote:
Thanks Deepak and Jeje.

the key to my solution was:

200605 = May 2006
20060505 = 5 may 2006

I recreated the time dimension table to have the following structure

column name>: <sample data
Year: 1980
Month: January 1980
Day: 1 January 1980
date: 1980-01-01 00:00:00Z
indexDay: 19800101
indexMonth: 198001

'indexDay' is the index for 'Day'. Likewise 'indexMonth' is the index for
'Month'. 'Year' is indexed against itself.

It works nicely now!

I have noticed that Year and Month are using an index of datatype integer.
However Day is using an index of datatype WChar. Shouldnt all indexes be
of type integer?

Cheers,

Peter



if you only use the month number the result could be like your issue.(the
month number only is not unique inthe hierarchy, may is under every year)

"peter walker" <p.walker (AT) nospam (DOT) com> wrote in message
news:eoYW9tnqGHA.4032 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
Hi, I have migrated a DTS package from SQL 2000 to SQL 2005. When I view
the time dimension within SQL 2005 I get the following:

http://tinyurl.com/hba6p

Why do I get (for example):

year = 2006, month = July 1987, Year = 1 July 2006 ?

I can't quite see why I am getting the year 1987 in the month column.
The month column has incorrect years, it should be:

year = 2006, month = July 2006, Year = 1 July 2006 ?

Any help most appreciated.

Peter








Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.