Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

explicitly assigning foreign key for a table?

Hi Experts,

Here is my question.

Below is a table called 'DimDate' table. In this table, 'DateKey' acts as an ID column and remaining are other additional columns.

DimDate
Datekey
Date
Month
Day
Year
Time

Below is another table called 'FactSales' table. As we see, there are three columns, ShipDateKey, OrderDateKey, and DueDateKey, which are supposed to be the 'DateKey' from the DimDate table as above..

FactSales
FactSalesID
ShipDateKey
OrderDateKey
DueDateKey
Amount
Product ID

Qlikview is not recognizing this association as the column names in the FactSales table are different from the one in the DimDate table for Key field.

How do we get this association done right?  Is it possible to achieve it.

Please kindly guide me.

Thank you.

3 Replies
amit_saini
Master III
Master III

Hi Pramod,

You can rename 'ShipDateKey' as DateKey  while calling FactSales Table. Similarly, you can do with OrderDateKey or DueDateKey  depending upon you requirement.

Thanks,
AS

Not applicable
Author

You need to determine which of the DateKeys in the 2nd table matches the DimDate table datekey, then (for example) in the Fact table load statement

ShipDateKey AS DateKey

Not applicable
Author

You need to join the Dimension table three time to find the respective date. First load the facttable and then load dimension table like Datekey as ShipDateKey, date as Shipdate. And  load the dimension table again like Datekey as OrderDateKey, date as Ordrdate.