One to many lookup, converted to a one to one dimension
up vote
0
down vote
favorite
I am struggling figuring out how to transform a one to many table structure from a transact database into a one to one dimension for a data warehouse.
In the transaction database the data structure is as:
Root Record (Parent_ID)
Lookup Table "Many Parent_IDs" (Patent_ID, Child_ID)
Reference Table (Child_ID, Name)
Joining to my reference table brings back a data set that looks like such:
╔═════════════╦═══════════╦══════════╦════════════╗
║ Root_ID ║ Root_Code ║ Child_ID ║ Child_Name ║
╠═════════════╬═══════════╬══════════╬════════════╣
║ 1 ║ 1000 ║ 22 ║ Name 1 ║
║ 1 ║ 1000 ║ 23 ║ Name 2 ║
║ 1 ║ 1000 ║ 24 ║ Name 3 ║
║ 1 ║ 1000 ║ 25 ║ Name 4 ║
║ 2 ║ 1150 ║ 67 ║ Name 5 ║
║ 2 ║ 1150 ║ 68 ║ Name 6 ║
║ 2 ║ 1150 ║ 69 ║ Name 7 ║
║ 3 ║ 2019 ║ 11 ║ Name 8 ║
║ 3 ║ 2019 ║ 12 ║ Name 9 ║
║ 5 ║ 2010 ║ 91 ║ Name 10 ║
║ 5 ║ 2010 ║ 92 ║ Name 11 ║
║ 5 ║ 2010 ║ 93 ║ Name 12 ║
║ 5 ║ 2010 ║ 94 ║ Name 13 ║
║ 5 ║ 2010 ║ 95 ║ Name 14 ║
║ 5 ║ 2010 ║ 96 ║ Name 15 ║
║ 6 ║ 5010 ║ 33 ║ Name 16 ║
╚═════════════╩═══════════╩══════════╩════════════╝
What I am after in my dimension is to know, Root_ID (1) has the values of Child_ID(22,23,24,25) and be able to reference that using the generated key on the dimension.
Keep in mind I can never predict how many child records there will be,
so creating X about of columns in my dimension isn't an option.
I am sure a wise data warehouse mind than me knows how this is normally handled.
To illustrate the desired result:
Fact Record (Dimension_Root_Key = 1)
Dimension (Key 1, Name 1, Name 2, Name 3, Name 4)
data-warehouse dimensional-modeling snowflake
add a comment |
up vote
0
down vote
favorite
I am struggling figuring out how to transform a one to many table structure from a transact database into a one to one dimension for a data warehouse.
In the transaction database the data structure is as:
Root Record (Parent_ID)
Lookup Table "Many Parent_IDs" (Patent_ID, Child_ID)
Reference Table (Child_ID, Name)
Joining to my reference table brings back a data set that looks like such:
╔═════════════╦═══════════╦══════════╦════════════╗
║ Root_ID ║ Root_Code ║ Child_ID ║ Child_Name ║
╠═════════════╬═══════════╬══════════╬════════════╣
║ 1 ║ 1000 ║ 22 ║ Name 1 ║
║ 1 ║ 1000 ║ 23 ║ Name 2 ║
║ 1 ║ 1000 ║ 24 ║ Name 3 ║
║ 1 ║ 1000 ║ 25 ║ Name 4 ║
║ 2 ║ 1150 ║ 67 ║ Name 5 ║
║ 2 ║ 1150 ║ 68 ║ Name 6 ║
║ 2 ║ 1150 ║ 69 ║ Name 7 ║
║ 3 ║ 2019 ║ 11 ║ Name 8 ║
║ 3 ║ 2019 ║ 12 ║ Name 9 ║
║ 5 ║ 2010 ║ 91 ║ Name 10 ║
║ 5 ║ 2010 ║ 92 ║ Name 11 ║
║ 5 ║ 2010 ║ 93 ║ Name 12 ║
║ 5 ║ 2010 ║ 94 ║ Name 13 ║
║ 5 ║ 2010 ║ 95 ║ Name 14 ║
║ 5 ║ 2010 ║ 96 ║ Name 15 ║
║ 6 ║ 5010 ║ 33 ║ Name 16 ║
╚═════════════╩═══════════╩══════════╩════════════╝
What I am after in my dimension is to know, Root_ID (1) has the values of Child_ID(22,23,24,25) and be able to reference that using the generated key on the dimension.
Keep in mind I can never predict how many child records there will be,
so creating X about of columns in my dimension isn't an option.
I am sure a wise data warehouse mind than me knows how this is normally handled.
To illustrate the desired result:
Fact Record (Dimension_Root_Key = 1)
Dimension (Key 1, Name 1, Name 2, Name 3, Name 4)
data-warehouse dimensional-modeling snowflake
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am struggling figuring out how to transform a one to many table structure from a transact database into a one to one dimension for a data warehouse.
In the transaction database the data structure is as:
Root Record (Parent_ID)
Lookup Table "Many Parent_IDs" (Patent_ID, Child_ID)
Reference Table (Child_ID, Name)
Joining to my reference table brings back a data set that looks like such:
╔═════════════╦═══════════╦══════════╦════════════╗
║ Root_ID ║ Root_Code ║ Child_ID ║ Child_Name ║
╠═════════════╬═══════════╬══════════╬════════════╣
║ 1 ║ 1000 ║ 22 ║ Name 1 ║
║ 1 ║ 1000 ║ 23 ║ Name 2 ║
║ 1 ║ 1000 ║ 24 ║ Name 3 ║
║ 1 ║ 1000 ║ 25 ║ Name 4 ║
║ 2 ║ 1150 ║ 67 ║ Name 5 ║
║ 2 ║ 1150 ║ 68 ║ Name 6 ║
║ 2 ║ 1150 ║ 69 ║ Name 7 ║
║ 3 ║ 2019 ║ 11 ║ Name 8 ║
║ 3 ║ 2019 ║ 12 ║ Name 9 ║
║ 5 ║ 2010 ║ 91 ║ Name 10 ║
║ 5 ║ 2010 ║ 92 ║ Name 11 ║
║ 5 ║ 2010 ║ 93 ║ Name 12 ║
║ 5 ║ 2010 ║ 94 ║ Name 13 ║
║ 5 ║ 2010 ║ 95 ║ Name 14 ║
║ 5 ║ 2010 ║ 96 ║ Name 15 ║
║ 6 ║ 5010 ║ 33 ║ Name 16 ║
╚═════════════╩═══════════╩══════════╩════════════╝
What I am after in my dimension is to know, Root_ID (1) has the values of Child_ID(22,23,24,25) and be able to reference that using the generated key on the dimension.
Keep in mind I can never predict how many child records there will be,
so creating X about of columns in my dimension isn't an option.
I am sure a wise data warehouse mind than me knows how this is normally handled.
To illustrate the desired result:
Fact Record (Dimension_Root_Key = 1)
Dimension (Key 1, Name 1, Name 2, Name 3, Name 4)
data-warehouse dimensional-modeling snowflake
I am struggling figuring out how to transform a one to many table structure from a transact database into a one to one dimension for a data warehouse.
In the transaction database the data structure is as:
Root Record (Parent_ID)
Lookup Table "Many Parent_IDs" (Patent_ID, Child_ID)
Reference Table (Child_ID, Name)
Joining to my reference table brings back a data set that looks like such:
╔═════════════╦═══════════╦══════════╦════════════╗
║ Root_ID ║ Root_Code ║ Child_ID ║ Child_Name ║
╠═════════════╬═══════════╬══════════╬════════════╣
║ 1 ║ 1000 ║ 22 ║ Name 1 ║
║ 1 ║ 1000 ║ 23 ║ Name 2 ║
║ 1 ║ 1000 ║ 24 ║ Name 3 ║
║ 1 ║ 1000 ║ 25 ║ Name 4 ║
║ 2 ║ 1150 ║ 67 ║ Name 5 ║
║ 2 ║ 1150 ║ 68 ║ Name 6 ║
║ 2 ║ 1150 ║ 69 ║ Name 7 ║
║ 3 ║ 2019 ║ 11 ║ Name 8 ║
║ 3 ║ 2019 ║ 12 ║ Name 9 ║
║ 5 ║ 2010 ║ 91 ║ Name 10 ║
║ 5 ║ 2010 ║ 92 ║ Name 11 ║
║ 5 ║ 2010 ║ 93 ║ Name 12 ║
║ 5 ║ 2010 ║ 94 ║ Name 13 ║
║ 5 ║ 2010 ║ 95 ║ Name 14 ║
║ 5 ║ 2010 ║ 96 ║ Name 15 ║
║ 6 ║ 5010 ║ 33 ║ Name 16 ║
╚═════════════╩═══════════╩══════════╩════════════╝
What I am after in my dimension is to know, Root_ID (1) has the values of Child_ID(22,23,24,25) and be able to reference that using the generated key on the dimension.
Keep in mind I can never predict how many child records there will be,
so creating X about of columns in my dimension isn't an option.
I am sure a wise data warehouse mind than me knows how this is normally handled.
To illustrate the desired result:
Fact Record (Dimension_Root_Key = 1)
Dimension (Key 1, Name 1, Name 2, Name 3, Name 4)
data-warehouse dimensional-modeling snowflake
data-warehouse dimensional-modeling snowflake
asked Nov 20 at 1:02
![](https://i.stack.imgur.com/ypA94.png?s=32&g=1)
![](https://i.stack.imgur.com/ypA94.png?s=32&g=1)
Caz1224
7751724
7751724
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Turns out I should have studied a little more. I have learnt the nomenclature of "Bridging" tables.
Knowing that the kimball group has some great demos on how to achieve what I wanted to. For further reading on Bridging tables
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Turns out I should have studied a little more. I have learnt the nomenclature of "Bridging" tables.
Knowing that the kimball group has some great demos on how to achieve what I wanted to. For further reading on Bridging tables
add a comment |
up vote
1
down vote
accepted
Turns out I should have studied a little more. I have learnt the nomenclature of "Bridging" tables.
Knowing that the kimball group has some great demos on how to achieve what I wanted to. For further reading on Bridging tables
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Turns out I should have studied a little more. I have learnt the nomenclature of "Bridging" tables.
Knowing that the kimball group has some great demos on how to achieve what I wanted to. For further reading on Bridging tables
Turns out I should have studied a little more. I have learnt the nomenclature of "Bridging" tables.
Knowing that the kimball group has some great demos on how to achieve what I wanted to. For further reading on Bridging tables
answered Nov 20 at 23:05
![](https://i.stack.imgur.com/ypA94.png?s=32&g=1)
![](https://i.stack.imgur.com/ypA94.png?s=32&g=1)
Caz1224
7751724
7751724
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384780%2fone-to-many-lookup-converted-to-a-one-to-one-dimension%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown