all groups > sql server data warehouse > december 2004 >
You're in the

sql server data warehouse

group:

How to handle heirarchies in dimension attributes (Fairly green design question)



How to handle heirarchies in dimension attributes (Fairly green design question) Louis Davidson
12/13/2004 2:27:12 PM
sql server data warehouse: For example, say I have a purchase fact table. Then I have a customer
dimension. In the customer dimension, we have city, state, name, etc, and
then we have a group level that needs to have a heirarchy exposed. For
example:

Super
Super Level 1
Super Level 2
Good
Good Level 1
Good Level 2

Obviously this is not what we are really using, but it is the same sort of
thing.

How to best do this? Using a related table?

Also, if there is a good way to search for this kind of discussion on
groups.google.com, advice there would be graciously accepted :)

--
----------------------------------------------------------------------------
Louis Davidson - drsql@hotmail.com
SQL Server MVP

Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)

Re: How to handle heirarchies in dimension attributes (Fairly green design question) Adam Machanic
12/13/2004 3:47:12 PM
Louis,

If I understand your question properly, you're interested in how to
represent a hierarchy in a dimension table, I assume without snowflaking
your schema? How deep is the hierarchy? One possible solution may be to
create additional columns in the dimension table such that each row will
contain a cross-tabulated representation of the hierarchy. That will
generally solve the problem easily -- and perform well -- if the hierarchy
is shallow enough (and its depth is known in advance). If you can't make
those kinds of guarantees during the design phase, I'm not sure how to solve
the problem other than snowflaking and having a separate hierarchy table.


--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--


[quoted text, click to view]

Re: How to handle heirarchies in dimension attributes (Fairly green design question) Louis Davidson
12/13/2004 11:21:07 PM
Actually I was asking without any preconcieved notions. I am very new to
the whole process of building a data warehouse so I am just learning. I
subsequently found the very same answer in Kimball's book, which I
apparently missed the first time I read through it. Being that I have built
only OLTP systems for 10 years, it is still a really strange process to me
:)

--
----------------------------------------------------------------------------
Louis Davidson - drsql@hotmail.com
SQL Server MVP

Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)

[quoted text, click to view]

Re: How to handle heirarchies in dimension attributes (Fairly green design question) Adam Machanic
12/14/2004 12:19:23 AM
[quoted text, click to view]

Wow, that's a great boost to my ego (giving the same answer as Kimball) -- I
haven't read his book in several years so either I absorbed it really well
or I'm finally really getting the hang of data warehousing :D

I am actually working on my first "real" OLTP system at the moment, after
years of doing DW (and a few very small semi-OLTP systems, nothing like the
retail system I'm working on now), so I'm in the opposite boat... Finally
learning how to properly deal with deadlocks, etc. Fun stuff!


--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--

AddThis Social Bookmark Button