Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
what is link table ,how to create that table and what is the use of that table?
Go through the attached document for the Link tables.
Regards
Anand
Hi,
Check this
http://community.qlik.com/blogs/qlikviewdesignblog/2013/05/17/concatenate-vs-link-table
Regards
ASHFAQ
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.
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