Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

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

3 posters

Go down

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

Post  MedicaidGirl 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

Back to top Go down

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

Post  nick_white 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 : 364
Join date : 2014-01-06
Location : London

Back to top Go down

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

Post  ngalemmo 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.
ngalemmo
ngalemmo

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

http://aginity.com

Back to top Go down

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

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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