Solved

Surrogate Keys Usage

Posted on 2013-11-14
4
281 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
  • 2
  • 2
4 Comments
 
LVL 37

Expert Comment

by:ValentinoV
Comment Utility
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
Comment Utility
Sounds like I need a new dim with only 4 rows then
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
Comment Utility
Well indeed, that would be the ideal solution :)
0
 

Author Closing Comment

by:nutnut
Comment Utility
Thanks for help
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now