dbTalk Databases Forums  

Group dimension members by first letter

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


Discuss Group dimension members by first letter in the microsoft.public.sqlserver.olap forum.



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

Default Group dimension members by first letter - 04-01-2005 , 02:19 AM






Hi,
I'm a bit new to cubes /yes yet another newbie ;op ).

The problem I have is taht when you want to show all customers in a cube
then it only shows some of them, after the letter F it stopes, and no
more customers are shown.

I don't know if my idea would work, but I would like to group the
customers by their first letter, so the dimension would look like this

ALL Customers
* A
Anders
Andy
* B
Burns
Barney
* C
Christine

etc.

and hopefully then all can be shown. I think it's a limit in how many
sustomers can be shown at once in the drop-down-list.

But honestly I don't know how to accomplish this. I've searched google
and the online books, but so far I've found nothing that makes sense in
my mind, when it comes to making something simmilar to my wish.

Could someone please show me light, and perhaps give me a hint on how to
accomplish this?

Thanx
Kristoffer

Reply With Quote
  #2  
Old   
Kristoffer Mortensen
 
Posts: n/a

Default Re: Group dimension members by first letter - 04-01-2005 , 05:58 AM






I've been researching some more, and what I need is a dummy parent,
being the alphabet, and then group the customers in the dummy parent/level.

Could someone please give me a hint on how to make this work?

/Kristoffer

Kristoffer Mortensen wrote:
Quote:
Hi,
I'm a bit new to cubes /yes yet another newbie ;op ).

The problem I have is taht when you want to show all customers in a cube
then it only shows some of them, after the letter F it stopes, and no
more customers are shown.

I don't know if my idea would work, but I would like to group the
customers by their first letter, so the dimension would look like this

ALL Customers
* A
Anders
Andy
* B
Burns
Barney
* C
Christine

etc.

and hopefully then all can be shown. I think it's a limit in how many
sustomers can be shown at once in the drop-down-list.

But honestly I don't know how to accomplish this. I've searched google
and the online books, but so far I've found nothing that makes sense in
my mind, when it comes to making something simmilar to my wish.

Could someone please show me light, and perhaps give me a hint on how to
accomplish this?

Thanx
Kristoffer

Reply With Quote
  #3  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Group dimension members by first letter - 04-01-2005 , 09:09 PM



Load your data through a view. In the view, add a computed column which is
the member name subst with just the first character. Then when you build
your dimension, say that there are two levels. First the one with just the
first character; then the level with the full name. Works like a champ, the
system that I am currently working on uses this approach for many of it's
larger dimensions.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Kristoffer Mortensen" <kmr (AT) dangaard (DOT) dk> wrote

Quote:
I've been researching some more, and what I need is a dummy parent,
being the alphabet, and then group the customers in the dummy
parent/level.

Could someone please give me a hint on how to make this work?

/Kristoffer

Kristoffer Mortensen wrote:
Hi,
I'm a bit new to cubes /yes yet another newbie ;op ).

The problem I have is taht when you want to show all customers in a cube
then it only shows some of them, after the letter F it stopes, and no
more customers are shown.

I don't know if my idea would work, but I would like to group the
customers by their first letter, so the dimension would look like this

ALL Customers
* A
Anders
Andy
* B
Burns
Barney
* C
Christine

etc.

and hopefully then all can be shown. I think it's a limit in how many
sustomers can be shown at once in the drop-down-list.

But honestly I don't know how to accomplish this. I've searched google
and the online books, but so far I've found nothing that makes sense in
my mind, when it comes to making something simmilar to my wish.

Could someone please show me light, and perhaps give me a hint on how to
accomplish this?

Thanx
Kristoffer



Reply With Quote
  #4  
Old   
James
 
Posts: n/a

Default Re: Group dimension members by first letter - 04-04-2005 , 03:58 AM



In your dimension, drag accross the customer name again (to create a
new level). Name it appropriately and then change the 'Member Key
Column' and 'Member Key Name' to LEFT(yourfieldname,1).

Reply With Quote
  #5  
Old   
Kristoffer Mortensen
 
Posts: n/a

Default Re: Group dimension members by first letter - 04-04-2005 , 04:58 AM



James wrote:
Quote:
In your dimension, drag accross the customer name again (to create a
new level). Name it appropriately and then change the 'Member Key
Column' and 'Member Key Name' to LEFT(yourfieldname,1).
Thanx, that works like a charm.
Can it have any impact on other users performance?
I made two extra levels, one sorting on the first letter, and a sublevel
ti taht taht sorts the first 2 letters, as the third leve, the entire
name is shown.
I'm getting complains that it takes almost 10 minutes to load the cube
after I made these changes, though I don't have to wait, it loads
imidiately.

I can't imagine that the changes I made would have any great impact on
the load time of the cude!?

/Kristoffer


Reply With Quote
  #6  
Old   
James
 
Posts: n/a

Default Re: Group dimension members by first letter - 04-04-2005 , 07:35 AM



Just drag the customer name over to the dimension area rename as
appropriate. Then alter the key column and key column name to
left(fieldname,1).

Reply With Quote
  #7  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Group dimension members by first letter - 04-05-2005 , 12:57 AM



Be careful of this technique.
It is a good hack for SQL Server 2000 -- I've used it all of the time.

The downside is that you have hardcoded the datasource into your SQL
statements (for example, the SQL fragment for string manipulation is
different between SQL Server and Oracle). That may or may not be an issue
for you.

However, the real issue is that this technique doesn't work so well with
Yukon.
In SQL Server 2005, you must use field names for names and keys -- you can't
put in SQL fragments like that. You have to use computed columns in either
the DSV or the relational source.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"James" <jerstep (AT) yahoo (DOT) com> wrote

Quote:
In your dimension, drag accross the customer name again (to create a
new level). Name it appropriately and then change the 'Member Key
Column' and 'Member Key Name' to LEFT(yourfieldname,1).



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.