dbTalk Databases Forums  

Wrong sorted time dimension

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


Discuss Wrong sorted time dimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Gugler
 
Posts: n/a

Default Wrong sorted time dimension - 10-13-2003 , 10:40 AM






hi!

we have a time dimension, with its own time table:
=============================================
CREATE TABLE [MyTime] (
[PKMyTime] [int] IDENTITY (1, 1)
[date] [datetime]
[Day] [varchar] (50)
[Month] [varchar] (50)
[Year] [smallint] NULL
[Quarter] [varchar] (50)
) ON [PRIMARY]
GO
=============================================
The Fact Table is referenced by tie PKMyTime with an
Foreign key,
everything works fine, except the oorder of the day.

when i wanna see the days (1st to 12th) for october, i get:
1
10
11
12
3
4
5
6
7
8
9

the main problem., also functions like lastperiods use
this sorting, so everyhting gets wrong!
how can i change this from string- to numeric order ?
the orderby field in the Dimension editor doesn't change
anything , even if i change the field type from wchar to
integer.

thanks for any help,
Thomas


Reply With Quote
  #2  
Old   
rharmon
 
Posts: n/a

Default Re: Wrong sorted time dimension - 10-13-2003 , 11:12 AM






In the dimension editor, highlight the field that's in the wrong order, go
to the properties pane, select advanced and set the "order by" property to
Name rather than ID. Re-process the dimension and all should be well.

Rob


"Thomas Gugler" <tg (AT) immobilien (DOT) net> wrote

Quote:
hi!

we have a time dimension, with its own time table:
=============================================
CREATE TABLE [MyTime] (
[PKMyTime] [int] IDENTITY (1, 1)
[date] [datetime]
[Day] [varchar] (50)
[Month] [varchar] (50)
[Year] [smallint] NULL
[Quarter] [varchar] (50)
) ON [PRIMARY]
GO
=============================================
The Fact Table is referenced by tie PKMyTime with an
Foreign key,
everything works fine, except the oorder of the day.

when i wanna see the days (1st to 12th) for october, i get:
1
10
11
12
3
4
5
6
7
8
9

the main problem., also functions like lastperiods use
this sorting, so everyhting gets wrong!
how can i change this from string- to numeric order ?
the orderby field in the Dimension editor doesn't change
anything , even if i change the field type from wchar to
integer.

thanks for any help,
Thomas




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.