Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
janus2021
Contributor III
Contributor III

fact tables and dimensions causing: circle reference or syntetic key

Hi.
A new beginner question:
If I have two fact tables and three-dimension tables. I want to link both fact tables to the same dimensions, is it possible to do without creating a synthetic key?
if I create duplicates of a term with different names in the dimension table and link to the different fact tables, it ends up with me getting a circle reference.

ex when duplicat/renamning kolumn in dimension-table:

See picture for circular referens that i get, then duplicat kolumn in load scrip doing:

Fact1:
Load
[PERI_K] as [P_S],
[ALDE_K] as [A_S],
[ANSTF_K] as [AN_S],
[KON_K] as [K_S],
[ORG_K] as [O_O_S]
from....

fact2:
load
[PERI_f] as [P_A],
[ALDE_K] as [A_A],
[ANSTF_K] as [AN_A],
[KON_K] as [K_A] ,
[ORG_K] as [O_O_A]
from …..

kon_D:
LOAD
[KON_S] as [K_A],
[KON_S] as [K_S]
from

Period_D:
LOAD
[PERI_S] as [P_A],
[PERI_S] as [P_S]
from …….

Anst_D:
load
[ANSTF_SN] as [AN_A],
[ANST_SN] as [AN_S]
From…….

Labels (2)
1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

hi,

you can concatenate them by using the concatenate statement.

Columns with same name are filled in same field, new columns are created, missing columns get value null

Regards

View solution in original post

4 Replies
martinpohl
Partner - Master
Partner - Master

Why do you want to load both facts into two tables?

concatenate them, all datas are in one fact table.

If the datas are similar add an extra field like datatype and use it in expression to different datas.

Regards

janus2021
Contributor III
Contributor III
Author

Hi.
Thanks for the answer, did not include it in my explanation but the two fact tables are separate tables in the database. They have more columns that are not equal but share some and these were the ones I included in the picture.
It is not possible to concatenate two tables that are not exactly the same, right?

What I now found is if "linked table" can solve the problem.
enl: https://www.analyticsvidhya.com/blog/2014/12/remove-synthetic-key-concatenation-link-table-qlikview/

right or wrong?

Fact1:
Load
[PERI_K] as [P_S],
[ALDE_K] as [A_S],
[ANSTF_K] as [AN_S],
[KON_K] as [K_S],
[ORG_K] as [O_O_S]
columnX,
columnY
from....

fact2:
load
[PERI_f] as [P_A],
[ALDE_K] as [A_A],
[ANSTF_K] as [AN_A],
[KON_K] as [K_A] ,
[ORG_K] as [O_O_A],
columnZ,
columnQ
from …..

martinpohl
Partner - Master
Partner - Master

hi,

you can concatenate them by using the concatenate statement.

Columns with same name are filled in same field, new columns are created, missing columns get value null

Regards

janus2021
Contributor III
Contributor III
Author

Hi.

Thanks for the answer. Both LinedTable and concatenate did work. Concatenate feels like that solution loads faster.

Regards