Storage of dimension values

View previous topic View next topic Go down

Storage of dimension values

Post  emonchen on Fri Jun 18, 2010 8:30 am

I have a fact table with orders that contains a field what kind of order it is. There are only five values that can be possible to be filled out in this field ("Unknown", "Web order", "Phone order", "Email order" and "Fax order"). What would be the best way to model this?

1. Create a lookup table with an ID and name that has five rows and put an integer with a foreign key to this lookup table in the fact table
2. Put the textual description as above in the fact table and build the dimensions from the distinct values from this column
3. Other options??

Thanks.

emonchen

Posts : 12
Join date : 2010-02-11
Age : 39
Location : Delft, The Netherlands

View user profile

Back to top Go down

Re: Storage of dimension values

Post  BoxesAndLines on Fri Jun 18, 2010 10:35 am

Your lookup table is called a dimension. Put distinct values in the dimension, create a surrogate key as the primary key and create a one to many relationship to the fact table.
avatar
BoxesAndLines

Posts : 1212
Join date : 2009-02-03
Location : USA

View user profile

Back to top Go down

Re: Storage of dimension values

Post  ngalemmo on Mon Jun 21, 2010 11:28 am

As B&L pointed out, option 1 is creating a dimension table for the order type.

Option 2 is strongly discouraged.

Another option would be to include the attribute (code and description) in another dimension if appropriate.
avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

Re: Storage of dimension values

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum