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

What is link table?

what is link table ,how to create that table and what is the use of that table?

5 Replies
its_anandrjs

Go through the attached document for the Link tables.

Regards

Anand

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you have two tables like below

Sales:

ProductID

Month

Sales

Budget:

ProductID

Month

Budget

We have more than one column in common, so if we join two tables synthetic will be generated (since we have ProductID and Month in both tables).  It is not advisable a datamodel with Synthetic keys.  To overcome this scenario we can use Link Table.

Sales:

LOAD

ProductID & '_'& Month AS Key,

Sales

FROM Sales;

Budget:

LOAD

ProductID & '_'& Month AS Key,

Budget

FROM Budget;

LinkTable:

LOAD DISTINCT

ProductID & '_'& Month AS Key,

ProductID,

Month

FROM Sales;

Concatenate(LinkTable)

LOAD DISTINCT

ProductID & '_'& Month AS Key,

ProductID,

Month

FROM Budget;

Hope this helps you.

Regards,

Jagan.

its_anandrjs

For more explanation you can go for the small example to under stand the link tables with simple example. Here is Three tables Sales, Budget and Customer and with the link tables they are connected to each other.

Sales:

LOAD Year&'_'&Month&'_'&[Customer Number] as Key,[Sale Amt],Year,Month,[Customer Number];

LOAD * INLINE [

    Year, Month, Customer Number, Sale Amt

    2013, 4, A, 15874

    2014, 5, B, 12569 ];

Budget:

LOAD Year&'_'&Month&'_'&[Customer Number] as Key,[Budget Amt],Year,Month,[Customer Number];

LOAD * INLINE [

    Year, Month, Customer Number, Budget Amt

    2013, 4, A, 45000

    2014, 5, B, 46000 ];

Customer:

Load * Inline

[

Customer NO,Customer Name

A,Kim

B,Saun ];

LinkTable:

LOAD Key,Year as YEAR,Month as MONTH,[Customer Number] as [Customer NO] Resident Sales;

LOAD Key,Year AS YEAR,Month AS MONTH,[Customer Number] as [Customer NO] Resident Budget;

DROP Fields Year,Month;

SalesTable:

LOAD Key,[Sale Amt] Resident Sales;

DROP Table Sales;

BudgetTable:

LOAD Key,[Budget Amt] Resident Budget;

DROP Table Budget;

Regards,

Anand

Anonymous
Not applicable