Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

How to create a link between two tables in script

I have 3 tables that share a field, but not all the values are the same.  I want to JOIN two of the tables to a table that has unique values only in it.  I am looking to do this so that when I create a table or a list box, I can use the field from the unique table so that when a user clicks on the name, the proper data is returned.  I've attached a copy of the QVW that I am working with.  I have qualified each name on the tables because I do not want a JOIN between the Slip and Backlog tables.  I just want to JOIN Slip and Backlog to ProjectManager on the field PM Name.

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

I see there is no link between the tables, there is no common field name as you were Qualifying PMName in every table.

Use this instead.

ProjectManager:

LOAD [PM Name]

FROM

[..\PM Names.xlsx]

(ooxml, embedded labels, table is ProjectManager);



QUALIFY *;

UnQualify PMName;

Backlog:

LOAD *,PMName as PMNameBlog

FROM

[..\PM Names.xlsx]

(ooxml, embedded labels, table is Backlog);

Slip:

LOAD *,PMName as PMNameSlip

FROM

[..\PM Names.xlsx]

(ooxml, embedded labels, table is Slip);

View solution in original post

14 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Do you really need a 3rd table with all possible values but each of them only once?

Just rename them so that all fields have the exact same name. A QlikView field (in a listbox) will only display unique values, whether you have 10000 identical copies or not.

cliff_clayman
Creator II
Creator II
Author

Yes, the issue is that when I create a straight table with additional data and click on the PM Name field, it does not limit the data correctly in other charts/tables because I am only using the field from one particular table.

aarkay29
Specialist
Specialist

may be this

LOAD

     [PM Name]

FROM

     [..\PM Names.xlsx](ooxml, embedded labels, table is Backlog);


concatenate

LOAD

     [PM Name]

FROM

     [..\PM Names.xlsx] (ooxml, embedded labels, table is Slip)

where

     Not Exist([PM Name]);

concatenate

LOAD

     [PM Name]

FROM

     [..\PM Names.xlsx] (ooxml, embedded labels, table is ProjectManager)

where Not Exist

     ([PM Name]);

cliff_clayman
Creator II
Creator II
Author

I'm not looking to make one table.  I am trying to solve for an issue where I have additional data in the Backlog and Slip tables.  I then create straight tables of data and click on the PM Name field in one of those straight tables.  The other straight tables that has a different PM Name from the other table does not get filtered.

aarkay29
Specialist
Specialist

If you are linking the tables with the key PM Name then when you select a PM Name only the respective PM Name will be filtered in the other tables as well.

There must be a different link key to link different PM names in different tables.

cliff_clayman
Creator II
Creator II
Author

Right, that is why I wanted to create the third table with the unique values only to be able to select from that instead of the PM Name from each table.  I added additional data to the QVW to help illustrate the issue.

albertovarela
Partner - Specialist
Partner - Specialist

Check this Technical brief. You may find it useful...

Concatenate vs Link Table

aarkay29
Specialist
Specialist

I see there is no link between the tables, there is no common field name as you were Qualifying PMName in every table.

Use this instead.

ProjectManager:

LOAD [PM Name]

FROM

[..\PM Names.xlsx]

(ooxml, embedded labels, table is ProjectManager);



QUALIFY *;

UnQualify PMName;

Backlog:

LOAD *,PMName as PMNameBlog

FROM

[..\PM Names.xlsx]

(ooxml, embedded labels, table is Backlog);

Slip:

LOAD *,PMName as PMNameSlip

FROM

[..\PM Names.xlsx]

(ooxml, embedded labels, table is Slip);

cliff_clayman
Creator II
Creator II
Author

Yes, that does it.  Thank you!