Dimension with hierarchical data - how to handle parent with no children

View previous topic View next topic Go down

Dimension with hierarchical data - how to handle parent with no children

Post  MedicaidGirl on Wed Jul 30, 2014 11:08 pm

If I have a product dimension with attributes including brand_name and product_name which is populated from the brand and product tables in the source system, when I get a new brand in the brand table but it has no products should I 1) add a row to the product dimension with the new brand_name and set product_name to "unknown" , 2) do not add a row to the product dimension but add a row to a subset conformed dimension for brand (which is a subset of columns from the product dimension), or 3) do something different. To me, putting a record in the product dimension, whose grain is a product, without a real product seems wrong. What do you think?

MedicaidGirl

Posts : 2
Join date : 2014-05-01

View user profile

Back to top Go down

Re: Dimension with hierarchical data - how to handle parent with no children

Post  nick_white on Thu Jul 31, 2014 7:49 am

I'd do the following:

1. Create a record in your subset Brand Dim regardless
2. Only create a record in your Product Dim if you need to reference it now in a fact table. You'd have to use dummy values for the Product attributes and then update the Dim record once you have the actual Product record
Otherwise don't create the Product Dim record until you have the details of the Product record

nick_white

Posts : 366
Join date : 2014-01-06
Location : London

View user profile

Back to top Go down

Re: Dimension with hierarchical data - how to handle parent with no children

Post  ngalemmo on Thu Jul 31, 2014 2:43 pm

There is nothing you need to do that is special in this case.  Just create brand and product dimension rows as needed.

From a hierarchy standpoint, it does not matter their are brands without products.  A product references a brand.  As products are introduced they would reference the appropriate brand and the hierarchy builds itself out.

From a query standpoint, if you want orphan brands to show up, use an outer join.
avatar
ngalemmo

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

View user profile http://aginity.com

Back to top Go down

Re: Dimension with hierarchical data - how to handle parent with no children

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


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