Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Fact Table Dependency

Hi everybody..

I've been working on a data model with 3 fact tables: Sales, Invoices and Purchase Orders. My model is connecting the 3 fact tables with a LinkTable using their common fields (Time_Id, Manufacturer_Id, Retailer_Id, Product_Id). So far so good, but there is a dependency between Invoices Fact Table and Purcharse Orders Fact Table because an invoice is related with a purchase order and one purchase order can have none, one or many invoices. I dont know how to model this without creating some "Frankestein" (Synthetic Key, Circular Reference, etc). Any ideas?

More or less my fact tables are described like this:

INVOICES:

Invoice_Id

, Time_Id

, Retailer_id

, Manufacturer_Id

, Product_Id

, Purchase_Order_Id

, Invoice_Number

, Invoice_Date

, Invoice_Quantity

, Invoice_Unit_Value;

PURCHASE_ORDERS:

Purchase_Order_Id

, Time_Id

, Retailer_id

, Manufacturer_Id

, Product_Id

, Purchase_Order_Number

, Purchase_Order_Date

, Order_Quantity

, Order_Unit_Value;

SALES:

Time_Id

, Retailer_id

, Manufacturer_Id

, Product_Id

, Sales_Quantity

, Sales_Unit_Value;

NOTE: Time, Retailer, Manufacturer, Product are my dimensions.

12 Replies
Anonymous
Not applicable
Author

Hola Sofía

Finalmente lo que hice fue una link table entre las tablas order, invoice y sales. Pero el problema ahora era el tema de las fechas ya que cada tabla de hechos tiene una fecha diferente (fecha de la orden, fecha de la factura, fecha de la venta).

Después de leer muchos foros, me tocó trabajar con un Master Calendar pero también dejar Calendarios particulares para cada tabla de hechos.

Espero que también hables español, jajajaja... sino me cuentas.

(I hope you speak spanish, if you dont, please reply and i will translate)

Not applicable
Author

Hola Fernando,

creo que nuestros nombres y apellidos nos delatan .

yo aun estoy a vueltas con mi solución, pues aun no lo tengo claro.

Por si quieres echarle un ojo a mi pregunta y comentar:

Concatenation of tables with different types of facts

Anonymous
Not applicable
Author

Hola Sofía

Jajajaja si... El modelo que yo estaba haciendo finalmente lo hice con un link table para poder relacionar las 3 tablas de hechos, aunque, como te dije, me tocó dejar 3 calendarios (1 para cada tabla de hechos). Si quieres me puedes enviar el .qvw con unos pocos datos para mirar mejor lo que estás haciendo a ver cómo te puedo ayudar.

cesar.rivadeneira@carvajal.com