Tabular - relationship acting like a cross join

  • I'm a bit perplexed on this.

    I have what is a 1:1 relationship.

    The parent table is SalesAssociatesCustomers (many entries per associate with each entry being a single customer that associate has worked with)

    Child table is Customers.

    SalesAssociatesCustomers.CustomerCode -> Customers.CustomerCode (CustomerCode is text)

    I open up Excel and drop the SalesAssociatesCustomers.AssociateID and SalesAssociatesCustomers.CustomerCode on the grid and it shows a proper:

    AssociateID|CustomerCode

    1|A001

    1|A002

    1|A003

    etc...

    just like it should.

    Then I go to the second table and get Customers.CustomerCode and drop it on there and I get:

    AssociateID|CustomerCode|CustomerCode

    1|A001|A001

    1|A001|A002

    1|A001|A003

    ...

    1|A001|C004

    Basically it is not restricting on CustomerCode and I don't really get why.... I am not even sure how to start troubleshooting this....

  • Maxer (5/22/2014)


    I'm a bit perplexed on this.

    I have what is a 1:1 relationship.

    The parent table is SalesAssociatesCustomers (many entries per associate with each entry being a single customer that associate has worked with)

    Child table is Customers.

    SalesAssociatesCustomers.CustomerCode -> Customers.CustomerCode (CustomerCode is text)

    I open up Excel and drop the SalesAssociatesCustomers.AssociateID and SalesAssociatesCustomers.CustomerCode on the grid and it shows a proper:

    AssociateID|CustomerCode

    1|A001

    1|A002

    1|A003

    etc...

    just like it should.

    Then I go to the second table and get Customers.CustomerCode and drop it on there and I get:

    AssociateID|CustomerCode|CustomerCode

    1|A001|A001

    1|A001|A002

    1|A001|A003

    ...

    1|A001|C004

    Basically it is not restricting on CustomerCode and I don't really get why.... I am not even sure how to start troubleshooting this....

    I am not sure what the actual question is. Is this an issue you are seeing in Excel or is this in your data or in a query? You really haven't provided much detail here for us to help.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Apologies: SSAS tabular mode I am creating a relationship between those two tables in the designer. Then when you open to analyze in Excel and add those columns I get that "cross join like" result.

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

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