Repeating a date in both a dim and fact

  • 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?

  • It would be easier to know what you are getting at if you post the schema of the tables.

  • 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

  • DimOrder doesn't look like a dimension table. It looks more like a fact table.

  • 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.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply