Fact or Dimension?

  • I have the following scenario:

    I have A revenue fact table with different dimensions, one of which is DimAccount.

    Background information:

    One order might have several transactions, and the order can be modified (for example, the order can be transferred from one account to another, or additional revenue can be posted to an existing order )

    I need to know the latest state of each order ( for example what is the account where it is assigned to now and the latest gross total for the order) so I set up a slowly changing dimension type 2 for Order (Dim Order) where I EndDate the order as changes happen, and enter a new row reflecting the latest state.

    Problem:

    I need to calculate order count, and be able to slice by Account (and all of the different attributes of DimAccount)

    I am not sure how to set up this scenario, it sounds to me like order should be a fact, but I don’t know that that would be right . To set it up as a fact, I would have to base the fact in a view that would change every day. In addition I would have to calculate the AccountKey from the view, since dimAccount is another slowly changing dimension type 2

    (

    create FactOrder

    as

    select Ordernumber, AccountKey ,gross etc…

    from DimOrder o

    Join dimaccount a on o.Acctno=a.acctno and a.endeffectivedt is null

    where endEffectiveDate is null

    )

    Any one has any suggestions about the best way to approach this?

Viewing 0 posts

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