Order or Order Status Dimension

View previous topic View next topic Go down

Order or Order Status Dimension

Post  cjrinpdx on Mon Aug 22, 2011 2:16 pm

I have a fact table names FactOrder. The users would like to slice the data in the fact table by order status. I could create an order dimension containing order status, but I have over four million orders. This seem to be a bit much to get just the order status (the order has no other attributes at this time that the users are interested in). Should I just create an order status dimension that would contain about ten records? Thanks.

cjrinpdx

Posts: 34
Join date: 2011-07-14
Location: Portland, OR

View user profile

Back to top Go down

Re: Order or Order Status Dimension

Post  thomaszhwang on Mon Aug 22, 2011 2:21 pm

I think you just need an Order Status dimension table.

thomaszhwang

Posts: 32
Join date: 2011-08-11

View user profile

Back to top Go down

Re: Order or Order Status Dimension

Post  ngalemmo on Mon Aug 22, 2011 2:45 pm

It is very uncommon to have an Order dimension. However, before you build your order status dimension, I suggest you take a good look at what information you have about orders and make sure you are not missing something. Attributes about an order should be covered by existing dimensions (such as date, customer, etc...) or new dimensions. In most cases, a junk dimension is a good vehicle to capture miscellaneous attributes that don't have anywhere else to go.

Try to capture all attributes that make sense. They may want status today, but they will most likely want additional attributes later. It is a real pain to add new dimensions to a fact table, particularly if it needs to be retroactive.

ngalemmo

Posts: 1732
Join date: 2009-05-15
Location: Los Angeles

View user profile http://aginity.com

Back to top Go down

Re: Order or Order Status Dimension

Post  cjrinpdx on Tue Aug 23, 2011 11:56 am

Thank you for your posts. I agree, but for some reason I have the urge to create an order dimension with OrderKey, BKOrderId, and OrderStatus and have OrderStatus be a type 2 SCD. I guess it depends on the business need; do they want to see the history of the order’s status, or just know the order status at the time the order line item was created?

cjrinpdx

Posts: 34
Join date: 2011-07-14
Location: Portland, OR

View user profile

Back to top Go down

Re: Order or Order Status Dimension

Post  ngalemmo on Tue Aug 23, 2011 12:44 pm

Resist the urge.

The thing is, orders change all the time and just about anything on the order will change. Rather than just trying to capture attribute change history in type 2 dimensions, you are better off capturing any change using a transactional fact table. When anything changes, just add one or two new fact rows reflecting the net change to the line (one row if there are only changes to the measures, two rows (a negative and a positive) when there are changes to dimensions). It will allow you to recreate an image of the order at any point in time. There is a fairly straight foward process to generate the new rows.

ngalemmo

Posts: 1732
Join date: 2009-05-15
Location: Los Angeles

View user profile http://aginity.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum