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)










share|improve this question


























    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)










    share|improve this question
























      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)










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 20 at 1:02









      Caz1224

      7751724




      7751724
























          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






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            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

























            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






            share|improve this answer

























              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






              share|improve this answer























                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






                share|improve this answer












                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 20 at 23:05









                Caz1224

                7751724




                7751724






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    Refactoring coordinates for Minecraft Pi buildings written in Python