dbTalk Databases Forums  

sort element in cubes

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


Discuss sort element in cubes in the microsoft.public.sqlserver.olap forum.



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

Default sort element in cubes - 08-10-2006 , 08:41 AM






Hi,

I have a table called Age Band which looks like this:

ID Description
1 0-5
2 0-5
3 0-5
4 0-5
5 0-5
6 6-10
.. .
.. .
.. .

I use the Descrption column in as an attribute in a Dimensional table
in the cube. Unfortunately when I browse the cube the description is
not sorted right - for example:
40-50
5-9
55-60

How can I solve this? I saw that the dimensionattributes can be ordered
by key, name and attributekey,attributename


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

Default Re: sort element in cubes - 08-10-2006 , 05:57 PM






Assuming that the "Age Band" table is in SQL Server,
you could replace the table with a Named Query in the Data Source View,
like:

Quote:
select ab1.ID, ab1.Description,
(select min(ID)
from [Age Band] ab2
where ab2.Description
= ab1.Description) as BandID
from [Age Band] ab1
Quote:
Then define BandID as the key for the Description attribute, and it can
be ordered by key.


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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.