dbTalk Databases Forums  

How do we create Multiple hierarchies in sql 200 as

comp.databases.olap comp.databases.olap


Discuss How do we create Multiple hierarchies in sql 200 as in the comp.databases.olap forum.



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

Default How do we create Multiple hierarchies in sql 200 as - 03-17-2005 , 01:50 PM






I have zip code as a dimension element in the fat table , Based on the
zip codes different custonmers have different regions defines for the
dimension , how can i define a different region level for each customer
based on the zipcode?

Aj


Reply With Quote
  #2  
Old   
--CELKO--
 
Posts: n/a

Default Re: How do we create Multiple hierarchies in sql 200 as - 03-18-2005 , 06:34 PM






Look up the nested set model for hierarchies or (better) buy a copy of
my book TREES & HIERARCHIES IN SQL. Each zip code grouping will be in
a table that looks like this:

CREATE TABLE AlphaRegions
(region_name CHAR(10) NOT NULL PRIMARY KEY,
start_zip CHAR(5) NOT NULL,
end_zip CHAR(5) NOT NULL,
CHECK (start_zip <= end_zip));

CREATE TABLE BetaRegions
(region_name CHAR(10) NOT NULL PRIMARY KEY,
start_zip CHAR(5) NOT NULL,
end_zip CHAR(5) NOT NULL,
CHECK (start_zip <= end_zip));

Etc. You can do any reporting hierarchy you wish with these tables.


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.