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

Two relations between two tables

Hi,

I have the table Department and a Fact table. The Fact table has two foreign keys END_DEP and START_DEP to the Department's primary key.

error loading image

To map them in QlikView I created two more columns of the DEP_KEY in the Department dimension, which have the same name as the ones in the Fact table. In QlikView I have:

SQL SELECT "DEP_KEY",
"DEP_KEY" AS "START_DEP",
"DEP_KEY" AS "END_DEP",
"DEP_NAME"
FROM NEWKIRK.DEPARTMENT;


SQL SELECT DAYS,
"END_DEP",
"START_DEP",
STATUS
FROM NEWKIRK.FACT;

error loading image

It creates synthetic keys, but I don't know if that is really what I want. I want two different relations from the Fact to the Department table.

Any ideas?

1 Reply
vidyut
Partner - Creator II
Partner - Creator II

Keep two Tables, One for Start_Dep, and one for End_Dep.

Or

if the Department has just the Dep_Key and Name, Do a join and bring Name into the Fact as Start_Dep_Name and End_Dep_Name