Self Referencing Relationship for FACT table ?

View previous topic View next topic Go down

Self Referencing Relationship for FACT table ?

Post  karan_das on Mon Mar 04, 2013 6:14 am

Hi ,

We have a scenario where a shipment has an invoice associated with it. This is the 'Original Invoice Number' assoc with a shipment. Now, whenever there is a change in the price of the shipment, a new invoice number is being generated.
I wish to capture the new invoice number for the same shipment, but also map back to the original invoice number in a FACT table.

Is it a good practice to have a self referencing connector for a FACT table ?

Thanks,
Karan
avatar
karan_das

Posts : 10
Join date : 2013-02-26
Age : 30

View user profile

Back to top Go down

Re: Self Referencing Relationship for FACT table ?

Post  ngalemmo on Mon Mar 04, 2013 2:02 pm

You invoice shipments, you don't ship invoices. Invoice facts should reference the shipment, not the other way around. It would solve the problem you describe as it no longer matters how many times an invoice is adjusted, as they only apply to one shipment.
avatar
ngalemmo

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

View user profile http://aginity.com

Back to top Go down

Re: Self Referencing Relationship for FACT table ?

Post  hayrabedian on Tue Mar 05, 2013 6:13 am

karan_das wrote:Hi ,
Is it a good practice to have a self referencing connector for a FACT table ?

Generally, it is a bad idea. Self joining a huge fact table might decrease the query performance by factors. Of course, there are exceptions ..

hayrabedian

Posts : 7
Join date : 2011-04-01

View user profile

Back to top Go down

Re: Self Referencing Relationship for FACT table ?

Post  Sponsored content


Sponsored content


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