Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Fact or Dimension? Expand / Collapse
Author
Message
Posted Friday, April 4, 2014 3:08 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, July 1, 2014 1:25 PM
Points: 57, Visits: 367
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?
Post #1558662
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse