SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Repeating a date in both a dim and fact


Repeating a date in both a dim and fact

Author
Message
aaa121
aaa121
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1299 Visits: 783
I have designed a warehouse which includes a type 2 order dimension and a accumulating snapshot table to analyse the position of an order in the process which may help to identify bottlenecks and inefficiencies in the process.

I have a order date on the order dimension but I also repeat this date along with several other key dates in the accumulating snapshot. This table also holds a key to the order dimension.

I find myself being challenged on this design by colleagues who believe I shouldn't be repeating this field in both tables.

I believe the design is an optimum one for the following reasons:

1. It would be much more costly to derive order to date metrics from the dimension and transactional facts.

2. Providing a different view of the data for analytical purposes at a preaggregated level ensures cube and reporting performance isn't compromised.

3. Some fields such as product for example won't be stored on the accumulating snapshot and this is not the purpose of the table although attributes such as this can still be obtained by using the dim order key anyway.

I am not one to drive a idea of my own through and I always like to gain general consesnus - hence this post!

Do you feel my approach is justified and I missing any drawbacks?
Michael Valentine Jones
Michael Valentine Jones
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14327 Visits: 11848
It would be easier to know what you are getting at if you post the schema of the tables.
aaa121
aaa121
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1299 Visits: 783
A little difficult to currently (not in the office or on a PC!!) I'll give it a shot...forgive any syntax errors!

So DimOrder is snowflakes to DimProduct and this is a condensed amount fields:

Create table DimOrder
(DimOrderKey int identity(1,1),
DimProductKey int,
DimOrderDateKey int,
DimOrderProcessed int,
DimOrderDispatchedKey int,
OrderType varchar(10),
DateRowStart datetime,
DateRowEnd date time,
IsRowCurrent bit)

Create table FactAccumSnapshot
(DimOrderKey int,
DimOrderDateKey int
,DimOrderProcessedDateKey int,
OrderDateToProcessLag int,
AmountPaidToDate money,
LastPaymentAmount money,
DimLastPaymentDateKey int)

The date keys are all based on role playing view back to dim date
Michael Valentine Jones
Michael Valentine Jones
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14327 Visits: 11848
DimOrder doesn't look like a dimension table. It looks more like a fact table.
aaa121
aaa121
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1299 Visits: 783
Sorry for the delay Micheal, as I mentioned I only included a condensed list of fields, other I can think of which are included are order description for example. The most important attributed for the business are associated dates.

However, since you ask......there are several attributes on a order which have a one-to-one relationship such as status, final outcome etc. etc. Now we are going off topic a little but originally I included these fields on the order dimension. The guys in the team wanted this separated out into separate dimensions so now we have several attributes which are snowflaked and will be 'flattened' in views to the cube.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search