?
Solved

Surrogate Keys Usage

Posted on 2013-11-14
4
Medium Priority
?
304 Views
Last Modified: 2013-11-22
Hi,

I am new to Datawarehouses.

I have a pre existing dimension table that I have to link to to get the Surrogate Key.  My problem is that the table contains 70 rows, I only need 4 of them.  I do not have an existing business Key to join to the Dim table so I need to join on a varchar column halfway across the dimension table.  For info - If I did a distinct on the column I need to join to it would return 6 values (4 I need and 2 I don't).  

I can do the join but I am concerned on what surrogate keys will be returned.  I only want 1 surrogate for each of the 4 codes but there are multiple surrogate for the same code that I pass in.  What should I do?

Thanks

nutnut
0
Comment
Question by:nutnut
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39650521
Sounds like you've got a design issue: "but there are multiple surrogate for the same code".

That's something we can't help you with, it all depends on your business rules.  First you need to figure out which record you want or need to match to your code.  Once you know that, you've practically solved the problem because you can then filter them out to get to a match set of only 4 records, each with a unique "code" lookup field to match on.
0
 

Author Comment

by:nutnut
ID: 39656047
Sounds like I need a new dim with only 4 rows then
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 2000 total points
ID: 39656331
Well indeed, that would be the ideal solution :)
0
 

Author Closing Comment

by:nutnut
ID: 39668381
Thanks for help
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to increase the row limit in Jasper Server.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question