Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Data Warehouse - pseudo Junk Dimension needed? Expand / Collapse
Posted Tuesday, June 30, 2009 2:16 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, November 25, 2016 4:02 PM
Points: 347, Visits: 350
I wanted to know what you think about this idea I propose. Have any of you had the
same situation? What did you do?

I am building a DW from ground up. SQL Server 2008.
Source System is an AS400 system. This system had edit checks on little lookup
fields (ie Payment Method) to ensure user only picks what is valid.
So I don't need to validate the code values in my SSIS pkgs.
But.....a code value of 1 or 2 is pretty useless for reporting(and 1 or 2 is what the source system sends me).
I need to know that thePaymentMethod is "Lockbox" or "ACH".

So, in my Customer MDS I have a table called Customer. It has a field called PaymentMethod
and the value is 1 (for Lockbox).
Do I store, in a junk dimension something like this:

ID Type Code Descr
1 PaymentMethod 1 Lockbox
2 PaymentMethod 2 ACH
3 TimeZone 1 Eastern
4 TimeZone 2 Mountain

and so on for all the little 3-5 available value code sets?

I"m just not certain its the best way....yet I dont want to add 10-15 more tables to
my Customer MDS either.
I could have the SSIS pkg add new records into the junk dimension as they become available,
I just don't want to hard-code these descriptions into the SQL select stmt (CASE stmt) and
then have to redeploy the pkg every time a new code is added to the source system.

Post #744855
Posted Thursday, July 2, 2009 6:14 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, November 25, 2016 4:02 PM
Points: 347, Visits: 350

Also, the other problem with doing this is that I would store the ID from the junk
dimension, which effectively means that the AS400 sent me a valueof 1 for Lockbox but I
store an ID of, say, 123. Makes it easier to get the description later on, but it is
replacing the original value from the source system.

Anyone have any better ideas?
Post #746182
Posted Thursday, July 2, 2009 2:22 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, March 5, 2015 12:08 PM
Points: 222, Visits: 441
Boy, there are definitely multiple schools of thought on this one. I've seen a lot of systems out there that combine simple code/description pairs like that into a single table with a "type" to differentiate them, and then look those values up using the code and the type. Me? I think that's great for a transactional system, but lousy for a DW solution. Make it as easy to develop against as possible. Strive to have as little explanation needed as possible for either developers or consumers.
When I've had lots of close to useless dimensions like that in a fact table, I combine them all horizontally into a single junk dimension table, which contains the permutations of the values. So from your example it would be:
TableName: DimCustomerCheck
CustomerCheckKey BKPaymentMethodID PaymentMethod BKTimeZoneID TimeZone
1 1 LockBox 1 Eastern
2 1 LockBox 2 Mountain
3 2 ACH 1 Eastern
4 2 ACH 2 Mountain

To populate the DimCustomerCheck table, you either pre-load it with all possible combinations, all theoretical combinations (if you don't trust your business users to tell you the real list of possible combinations!) or you put in a fairly simple ETL that pulls the distinct combinations from the source system and populates new rows as you go along. Then your SSIS lookup would just be based on the BKPaymentMethodID AND the BKTimeZoneID.

Hopefully I've understood what you were asking and presented you with a viable solution,

Rick Todd
Post #746627
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse