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


Fact or Dimension?


Fact or Dimension?

Author
Message
sandra pastrana
sandra pastrana
SSC Veteran
SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)SSC Veteran (235 reputation)

Group: General Forum Members
Points: 235 Visits: 371
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?
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