Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jjustingkm
Creator
Creator

Data from multiple fact tables

Hi Qlik Community,

I have been using Qlik a couple of months ago (been in BI mainly BO for 10 years).  Have a question regarding using multiple fact tables.  If a dimension table is shared by multiple fact tables , will it cause incorrect result, may be circular reference. Just created some sample data for this scenario. Help would be really appreciated.

 

SALES   PURCHASE  
REGIONSALESDATE REGIONSTATESALESDATE
1401/1/2020 1A81/1/2020
2201/1/2020 1B61/2/2020
3201/3/2020 3D41/4/2020
4101/4/2020 4E21/4/2020
REGION   DATE   
REGIONNAME  DATEYEAR  
1NORTH  1/1/20202020  
2SOUTH  1/2/20202020  
3WEST  1/4/20202020  
4EAST  1/4/20202020  
        

 

 

1 Solution

Accepted Solutions
marcus_sommer

Often it could work. Could means that you may need some transformations by certain fact-tables. For example a quite common case. There are sales on a daily level in one fact-table and budgets on a monthly level in another fact-table. Directly concatenated as they are it won't work but if you creates per makedate(year, month) an appropriate date-field you could merge both tables.

For many views like comparing the forecasted sales against the budgets on a monthly or higher level it will work quite well - we do this quite often. If there is no forecast available or the comparing needs to be displayed on a daily/weekly level the above won't work. In this case you need to distribute the monthly budgets on a daily level which is often not very complicated (just joining the dates and the max. amount of dates per month from a calendar-table against the budget and then just dividing the budget-value.

Similar approaches should be in the most cases applicable.

Of course those measures needs some efforts but quite often do you need them to do regardless which kind of datamodel should be used in the end - and the alternatives to this star-scheme data-model are usually much more complex and often with disadvantages in regard to handling, maintaining and performance.

- Marcus

View solution in original post

3 Replies
Ksrinivasan
Specialist
Specialist

hi

Ksrinivasan_0-1611251434307.png

ksrinivasan

jjustingkm
Creator
Creator
Author

Thanks for the reply. but if there are multiple fact tables at different granular level, will this work?

marcus_sommer

Often it could work. Could means that you may need some transformations by certain fact-tables. For example a quite common case. There are sales on a daily level in one fact-table and budgets on a monthly level in another fact-table. Directly concatenated as they are it won't work but if you creates per makedate(year, month) an appropriate date-field you could merge both tables.

For many views like comparing the forecasted sales against the budgets on a monthly or higher level it will work quite well - we do this quite often. If there is no forecast available or the comparing needs to be displayed on a daily/weekly level the above won't work. In this case you need to distribute the monthly budgets on a daily level which is often not very complicated (just joining the dates and the max. amount of dates per month from a calendar-table against the budget and then just dividing the budget-value.

Similar approaches should be in the most cases applicable.

Of course those measures needs some efforts but quite often do you need them to do regardless which kind of datamodel should be used in the end - and the alternatives to this star-scheme data-model are usually much more complex and often with disadvantages in regard to handling, maintaining and performance.

- Marcus