Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help on Link Tables

Hi all,

I am trying to create a link table for my 2 Facts and 5 dim tables but i am not getting exactly how the link table gets created .

Can any one please give me a sample code as how to create link table or

Help me to modify my qvw file to avoid the synthatic keys and create a linked table.

Thanks,

Rashmi

Labels (1)
3 Replies
martin59
Specialist II
Specialist II

Hi, if your four fields define your primary key, you have to do something like that :

hash128(CLIENT_DIM_KEY, OS_DIM_KEY, OS_LANGUAGE_KEY, OS_COUNTRY_KEY) as FactKey,


or

autonumber(CLIENT_DIM_KEY &'_'& OS_DIM_KEY &'_'& OS_LANGUAGE_KEY &'_'& OS_COUNTRY_KEY) as FactKey,


or

CLIENT_DIM_KEY &'_'& OS_DIM_KEY &'_'& OS_LANGUAGE_KEY &'_'& OS_COUNTRY_KEY as FactKey,


Copy this code into your both facts tables and suppress the four fields (CLIENT_DIM_KEY, OS_DIM_KEY, OS_LANGUAGE_KEY, OS_COUNTRY_KEY) into one of them.

Hope that helps you

Not applicable
Author

Hi,

what Martin told is correct. I added the code. Depending on the Facttable which you want to use, comment the KEYS on the other one. I did comment in one of your facttable as an example. check it.

[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.00.49.52/TestRashmi.qvw]

Not applicable
Author

Thanks Martin and Sravan,

I appreciate your help but my problem is i don't want to link these fact tables they are separate and not related to each other that's why I thought of link table so that all dim tables will be linked to my link table and then fact table will again link to link table. but i am not getting how to create a link table

Please suggest me any good option to achieve this .