1 Dimension 1 Fact table connected by 2 Keys

  • Hi, I hope all is well.

    I'm having a dilemma in my cube setup and i hope you guys can help.

    I have 1 cube dimension created from a UNION of 2 Dimension tables leaving me with duplicate keys on 1 column. To get around this, in my DSV I connect this dimension to the FACT table with 2 Relationships. Seen below:

    Somehow this relationship is not being followed when I view the cube.

    have you guys encountered this?

  • Two relationships are two seperate relationships (like role playing dimensions); it's not the same as one relationship with a compound key of 2 columns.

    I think it would be more ideal to create a new surrogate key in your UNION ALL statement (you could use ROWNUMBER()) and create a relationship using that new surrogate key.

    If you use ROWNUMBER(), you better do a full process each time, as the keys might change.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Hi Koen!

    Thanks for your response!

    I did try your suggestion and it worked! I used a concatination of the 2 keys and some other character to make sure every key is unique and also did the same on my Fact table.

    Thanks again for your help.

  • michaeleusebio721 (7/3/2013)


    Hi Koen!

    Thanks for your response!

    I did try your suggestion and it worked! I used a concatination of the 2 keys and some other character to make sure every key is unique and also did the same on my Fact table.

    Thanks again for your help.

    No problem, glad to help and thanks for posting back!

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply