Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 | ||||||
REGION | SALES | DATE | REGION | STATE | SALES | DATE | |
1 | 40 | 1/1/2020 | 1 | A | 8 | 1/1/2020 | |
2 | 20 | 1/1/2020 | 1 | B | 6 | 1/2/2020 | |
3 | 20 | 1/3/2020 | 3 | D | 4 | 1/4/2020 | |
4 | 10 | 1/4/2020 | 4 | E | 2 | 1/4/2020 | |
REGION | DATE | ||||||
REGION | NAME | DATE | YEAR | ||||
1 | NORTH | 1/1/2020 | 2020 | ||||
2 | SOUTH | 1/2/2020 | 2020 | ||||
3 | WEST | 1/4/2020 | 2020 | ||||
4 | EAST | 1/4/2020 | 2020 | ||||
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
hi
ksrinivasan
Thanks for the reply. but if there are multiple fact tables at different granular level, will this work?
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