Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Two Fact tables connecting to same dimension tables

Hi all,

I have two fact tables which connect to multiple dimmension tables through the same fields, thus forming syntetic keys.

How do i overcome this ?

Please find attachment

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Have a look at the attached example.

    Hope this will give you clear idea

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

5 Replies
Not applicable
Author

for each dimension table create new fields to remove synthetic tables.

The links may contain the same fields, just name them differently for each link

mr_novice
Creator II
Creator II

Concatenate the two fact tables to one. You could add a column to see difference between fact rows.

Fact:

LOAD * INLINE [

    Sales_ID, Bill_ID, Ship_ID, Product_ID, Customer_ID, Region_ID, Sales_QTY, fType

    1,1,1,1,1,1,1,'Sales'

];

Concatenate(Fact)

LOAD * INLINE [

    Orders_ID, Bill_ID, Ship_ID, Product_ID, Customer_ID, Region_ID, Orders_QTY, fType

    1,1,1,1,1,1,1,'Order'

];

Not applicable
Author

Hi,

Did you find a solution for this? Concatenating dimension tables into 1 table doesnt seem to be a practical option. wouldnt that mean they will under the same column name?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Have a look at the attached example.

    Hope this will give you clear idea

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

I would join the fact tables with the dimension tables, renaming the fields so as to avoid the data being linked - that way you will have two data islands and can re-label your fields in the charts and dropdowns

Example (excuse the odd data)

FactTable1:

LOAD * INLINE [

Meal,PortionID

Big Mac,1

Veggie Delite (Subway),1

Prawn Salad,1,Salad,239

];

Left join

LOAD * INLINE [

Meal,TotFat,TotSugar

Big Mac,24,41

Veggie Delite (Subway),1.9,41

Prawn Salad,14.8,9.3

];

FactTable2:

LOAD * INLINE [

Meal_1,PortionID_1

Brownies,1

];

Left join

LOAD * INLINE [

Meal_1,TotFat_1,TotSugar_1

Brownies,24,41

];

Chris

http://oneqlikatatime.blogspot.co.uk/