Jump to content


Photo

Creating relationships in the Excel data model


  • Please log in to reply
1 reply to this topic

#1 JPK1066

JPK1066

    Advanced Member

  • Members
  • PipPipPip
  • 83 posts

Posted 18 June 2016 - 07:36 PM

I'm trying to establish a data model between the two tables in the WB attached. The 'Game ID' 1st column has has all unique dates on that table and I wanted to use that column as the primary key column on that WS. The 'Game ID" column on the Pitching WS would be the foreign key on that sheet. When I try to establish the relationship the dialogue does not see the two worksheets so I can't initiate the relationship. Can you help me out?

 

JPK1066

Attached Files



#2 Jonathan

Jonathan

    Forums Administrator

  • Administrators
  • 845 posts

Posted 18 June 2016 - 11:06 PM

Hi JPK1066,

 

The problem here is that the table in your Pitching worksheet spans every possible cell in the worksheet, meaning it has over 16,000 columns. The Relationships dialog isn't capable of handling this many columns, which is why you weren't able to create the relationship.

 

I have recreated the Pitching table so that it only spans the width and height of the data within it, and was then able to create a relationship as shown in Expert Skills Lesson 6-2 Create a simple data model.

For more on creating Tables, see the video lesson: Expert Skills Lesson 1-11 Convert a range into a table and add a total row.

 

I have attached a copy of your workbook with the table resized and the relationship added:

 

Attached File  Baseball.xlsx   947.09KB   39 downloads

Baseball.png

 

I hope this is the answer you were looking for, but please feel free to reply if you need any more help with this.


Jonathan is part of the professional team who answer Excel-related questions posted on the ExcelCentral.com forums.
Jonathan also tests our courses prior to publication and has worked on all of our ten world bestselling Excel books for Excel 2007, Excel 2010, Excel 2013, Excel 2016 for Windows and Excel 2016 for Apple Mac. Jonathan has also worked on over 850 video lessons for or video courses covering Excel 2007, Excel 2010 and Excel 2013.
As well as extensive Excel knowledge, Jonathan has worked in the IT world for over thirteen years as a programmer, database designer and analyst for some of the world's largest companies.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users