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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sebastian_Dec
Creator II
Creator II

Connect multiple same tables with the difrent Key

Hi, I have ONE table, that i want to add 10 other tables with difrent key.

I noticed that Qlik always connects the first table, but not the next one, unfortunately there will be about 10 connections in the code, because I have one dictionary, but products are very differently connected into main categories due to different specifics of suppliers.

For example, main tabel:

Main_table:
LOAD
ArtId,
Supplier_Id,
Supplier_name,
Dossier,
Date_Order,
Date_Delivery,
Grouping_Lvl_2,
Grouping_Lvl_3,
Product_range,
Brand
FROM [lib://QlikContainers\Table.qvd]
(qvd);

left Join (Main_table)
Load
[SCABEL],
[KOD DOSTAWCA] as Supplier_Id,
FOURNISSEUR,
[GAMME DU FOURNISSEUR],
[KOD GAMY],
[NAZWA GAMY] as Product_range,
[GAMME DU FOURNISSEUR FR],
[KOD RODZINA] as Grouping_Lvl_2,
[NAZWA RODZINA],
[CATEGORIE (PL)],
[KOD PODRODZINA],
[NAZWA PODRODZINA],
[CATEGORIE EN],
[CATEGORIE FR],
[RODZAJ KLUCZA]
FROM [lib://QlikContainers\OPIS GAM.xlsx]
(ooxml, embedded labels, table is slownik)
Where [RODZAJ KLUCZA] = 'Supplier + Product_range + Grouping_Lvl_2'
;

 

left Join (Main_table)
Load
[SCABEL],
[KOD DOSTAWCA] as Supplier_Id,
FOURNISSEUR,
[GAMME DU FOURNISSEUR],
[KOD GAMY],
[NAZWA GAMY] as Product_range,
[GAMME DU FOURNISSEUR FR],
[KOD RODZINA],
[NAZWA RODZINA],
[CATEGORIE (PL)],
[KOD PODRODZINA],
[NAZWA PODRODZINA],
[CATEGORIE EN],
[CATEGORIE FR],
[RODZAJ KLUCZA]
FROM [lib://QlikContainers\OPIS GAM.xlsx]
(ooxml, embedded labels, table is slownik)
Where [RODZAJ KLUCZA] = 'Supplier + Product_range'
;

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Labels (2)
2 Solutions

Accepted Solutions
profilejamesbond
Creator II
Creator II

Hi,

Based on your key fields "Supplier_Id, Product_range" data is left joined.

As you wrote in the question, the data are different in every table therefore, you have no join actually, therefore, you see only the main table not the other tables.

You can perform join or outer join to bring the data into the same table. Please remember if there is no association in between data based on Key fields then you will not see the data reflection via filters.

Thanks

View solution in original post

henrikalmen
Specialist II
Specialist II

You can join as many tables as you like to the first one, as long as your key fields have the same name in the tables to be joined as in the original table (that can easily be solved by renaming fields when you "joinload" them). And naturally, the contents of the key fields need to match. You have renamed [KOD DOSTAWCA] as Supplier_Id, so if there are matching values for a row in the combination of Supplier_Id and Product_range there will be a join, otherwise not.

But that only goes for the first join, because when that is performed the Main_table has got new fields like for example FORNISSEUR. When you try to do a new join, you attempt to add even more columns that have the same names. That doesn't work. Or actually, you're comparing ALL of the columns but there will be nno join in the last step because there are no additional columns to add.

In the given example, you should first concatenate the two tables that you want to join, since those tables seem to have the same structure. Something like this:

jointable:
load * from FROM [lib://QlikContainers\OPIS GAM.xlsx] (ooxml, embedded labels, table is slownik) Where [RODZAJ KLUCZA] = 'Supplier + Product_range + Grouping_Lvl_2';
concatenate(jointable)
load distinct * FROM [lib://QlikContainers\OPIS GAM.xlsx] (ooxml, embedded labels, table is slownik) Where [RODZAJ KLUCZA] = 'Supplier + Product_range';

left join(Main_table) load ... resident jointable;
drop table jointable;

 

Joining tables adds columns from the first table from the second table. Concatenating tables adds rows to the first table from the second table. A table may not have multiple columns with the same name. But this you probably know already.

View solution in original post

4 Replies
henrikalmen
Specialist II
Specialist II

What is your question..?

profilejamesbond
Creator II
Creator II

Hi,

Based on your key fields "Supplier_Id, Product_range" data is left joined.

As you wrote in the question, the data are different in every table therefore, you have no join actually, therefore, you see only the main table not the other tables.

You can perform join or outer join to bring the data into the same table. Please remember if there is no association in between data based on Key fields then you will not see the data reflection via filters.

Thanks

Sebastian_Dec
Creator II
Creator II
Author

@henrikalmen sorry for the lack of clarification, I would like to know how to connect tables in such a way that the same dictionary with different keys can be connected 10 times to one main table.

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
henrikalmen
Specialist II
Specialist II

You can join as many tables as you like to the first one, as long as your key fields have the same name in the tables to be joined as in the original table (that can easily be solved by renaming fields when you "joinload" them). And naturally, the contents of the key fields need to match. You have renamed [KOD DOSTAWCA] as Supplier_Id, so if there are matching values for a row in the combination of Supplier_Id and Product_range there will be a join, otherwise not.

But that only goes for the first join, because when that is performed the Main_table has got new fields like for example FORNISSEUR. When you try to do a new join, you attempt to add even more columns that have the same names. That doesn't work. Or actually, you're comparing ALL of the columns but there will be nno join in the last step because there are no additional columns to add.

In the given example, you should first concatenate the two tables that you want to join, since those tables seem to have the same structure. Something like this:

jointable:
load * from FROM [lib://QlikContainers\OPIS GAM.xlsx] (ooxml, embedded labels, table is slownik) Where [RODZAJ KLUCZA] = 'Supplier + Product_range + Grouping_Lvl_2';
concatenate(jointable)
load distinct * FROM [lib://QlikContainers\OPIS GAM.xlsx] (ooxml, embedded labels, table is slownik) Where [RODZAJ KLUCZA] = 'Supplier + Product_range';

left join(Main_table) load ... resident jointable;
drop table jointable;

 

Joining tables adds columns from the first table from the second table. Concatenating tables adds rows to the first table from the second table. A table may not have multiple columns with the same name. But this you probably know already.