Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Storage of dimension values

3 posters

Go down

Storage of dimension values Empty Storage of dimension values

Post  emonchen 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 : 45
Location : Delft, The Netherlands

Back to top Go down

Storage of dimension values Empty Re: Storage of dimension values

Post  BoxesAndLines 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.
BoxesAndLines
BoxesAndLines

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

Back to top Go down

Storage of dimension values Empty Re: Storage of dimension values

Post  ngalemmo 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.
ngalemmo
ngalemmo

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

http://aginity.com

Back to top Go down

Storage of dimension values Empty Re: Storage of dimension values

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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