Columns to Rows Issue in Dimension
5 posters
Page 1 of 1
Columns to Rows Issue in Dimension
This is my DimCustomer:
We want to be able to tell how many customers at any point in time have RED as favorite color, or ITA as favorite food.
My guess is that this probably needs to be a Factless-Fact table:
Is that the best way to approach this problem?
SKey | NKey | FOOD1 | FOOD2 | COLOR1 | COLOR2 |
1 | 111 | CHI | AM | RED | BLUE |
2 | 222 | AM | ITA | ORANGE | YELLOW |
We want to be able to tell how many customers at any point in time have RED as favorite color, or ITA as favorite food.
My guess is that this probably needs to be a Factless-Fact table:
SKey | FKey | K | V |
1 | 1 | FOOD | CHI |
2 | 1 | FOOD | AM |
3 | 1 | COLOR | RED |
4 | 1 | COLOR | BLUE |
5 | 2 | FOOD | AM |
6 | 2 | FOOD | ITA |
7 | 2 | COLOR | ORANGE |
8 | 2 | COLOR | YELLOW |
Is that the best way to approach this problem?
ohmycamote- Posts : 14
Join date : 2011-07-05
Re: Columns to Rows Issue in Dimension
Or a bridge table. You could cram all the colors into one column, but I always cringe when I see that.
BoxesAndLines- Posts : 1212
Join date : 2009-02-03
Location : USA
Re: Columns to Rows Issue in Dimension
I'm sorry but I am quite new to BI, so what would the bridge look like in this case?
Thank you for your time.
Thank you for your time.
ohmycamote- Posts : 14
Join date : 2011-07-05
Re: Columns to Rows Issue in Dimension
why donīt you launch a simple query against the dimension and filtering by the criteria you want?
Unless you have any other type of specific reporting requirements, I wouldnīt do anything but a quick query.
Unless you have any other type of specific reporting requirements, I wouldnīt do anything but a quick query.
apermag- Posts : 17
Join date : 2011-06-28
Re: Columns to Rows Issue in Dimension
I just found this reply from ngallemo:
http://forum.kimballgroup.com/t689-bridge-table-for-patient-diagnosis#2893
I assume you are referring to the same thing?
http://forum.kimballgroup.com/t689-bridge-table-for-patient-diagnosis#2893
I assume you are referring to the same thing?
ohmycamote- Posts : 14
Join date : 2011-07-05
Re: Columns to Rows Issue in Dimension
Yes. Although I am still not sure what you are trying to build. A better approach is to tell us what you want and then we can help with the how.
BoxesAndLines- Posts : 1212
Join date : 2009-02-03
Location : USA
Re: Columns to Rows Issue in Dimension
In the first table of your initial post, why do you have two columns for food and color? what's the difference between FOOD1 and FOOD2?
hang- Posts : 528
Join date : 2010-05-07
Location : Brisbane, Australia
Re: Columns to Rows Issue in Dimension
Hang,
My original DimCustomer looks like that with two FOOD and two COLOR fields because the source DB stored it like that.
That's why I am asking what is the best practice when storing such data in the data warehouse DB.
Thank you
My original DimCustomer looks like that with two FOOD and two COLOR fields because the source DB stored it like that.
That's why I am asking what is the best practice when storing such data in the data warehouse DB.
Thank you
ohmycamote- Posts : 14
Join date : 2011-07-05
Re: Columns to Rows Issue in Dimension
What you have is a many-to-many relationship between dimensions, i.e. customer to color, and customer to food. You could create a factless fact table, or combine the color and food dimensions into a junk dimension and make it an outrigger off the customer employee.
cjrinpdx- Posts : 51
Join date : 2011-07-14
Location : Portland, OR
Similar topics
» Adding additional columns or rows to a dimension
» conformed dimension issue
» Dealing with Duplicate Dimension Rows
» Time bound variables YTD ,QTD as columns or rows.
» Model Design best practice - add columns or pivot data for multiple rows ?
» conformed dimension issue
» Dealing with Duplicate Dimension Rows
» Time bound variables YTD ,QTD as columns or rows.
» Model Design best practice - add columns or pivot data for multiple rows ?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum