Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
MohasinKhan
Contributor III
Contributor III

Join 2 Tables with 2 different dimensions

hello all,

I have 2 questions related to joining tables, hoping someone can help.

First Question:

It is more like using OR condition from Table1 and trying the match results from Table 2.

Example Below: I am trying to match Account name Or Account Internal Name to table 2 (Name).

Question1.PNG

 

Second Question:

Is it possible to connect 2 different dimensions from 1 table to 2 different dimensions from second table. I am just starting Qliksense and not sure about many thing. please advice.

Example below: I am trying to connect Account ID from Table 1 to to Account ID from table 1, and at the same time, connecting Parent Account name from both tables to get Category. Not sure if this is possible.

Question2.PNG

Labels (1)
1 Solution

Accepted Solutions
MohasinKhan
Contributor III
Contributor III
Author

Thank you guys for sharing the script, I was not able to get the desired results from there. Maybe i was doing something wrong.

I tried a long method and it worked as i expected. Below is the script:

Temp_Table1:
Load
Account Name,
Account Internal Name,
Account Internal Name as 'Name',
FROM [lib://data/Source.xlsx]
(ooxml, embedded labels, table is Sheet1);


Temp_Table2:
Load
Name as 'Account Name',
Category
FROM [lib://data/Source.xlsx]
(ooxml, embedded labels, table is Sheet2);

No Concatenate
Temp_Table3:
Load
Name,
Category
FROM [lib://data/Source.xlsx]
(ooxml, embedded labels, table is Sheet2);


Main Table:

Load
Account Name,
Account Internal Name,
Category

Resident Temp_Table1;
Drop Temp_Table1;

View solution in original post

3 Replies
avincesilao
Partner - Contributor
Partner - Contributor

Hi Mohasin,
I have been using and studying Qlik Sense for 2 months bit enough to answer that in this case where the name filed of the two table are the same during the uploading data automatically Ln create a Cocatenation of this two table and in this case you will get right the expected result.
Regards.
Antonio
rajaxavier
Contributor
Contributor

Hi Mohasin, 

               Please try the below script in backend

Map_Tab1:
Mapping
LOAD
Name,
Category
FROM [lib://data/Applymap.xlsx]
(ooxml, embedded labels, table is Sheet2);

Tab1:
Load
ApplyMap('Map_Tab1', "Account Internal Name", ApplyMap('Map_Tab1', "Account Name",'Missing'))
as Category,
"Account Name",
"Account Internal Name"
FROM [lib://data/Applymap.xlsx]
(ooxml, embedded labels, table is Sheet1);


Map_Tab2:
Mapping
LOAD
"Parent Account",
Category
FROM [lib://data/Applymap.xlsx]
(ooxml, embedded labels, table is Sheet4);

Tab2:
Load
ApplyMap('Map_Tab2',"Parent Account", '-') as Categories,
"Account ID",
"Parent Account"
FROM [lib://data/Applymap.xlsx]
(ooxml, embedded labels, table is Sheet3);

MohasinKhan
Contributor III
Contributor III
Author

Thank you guys for sharing the script, I was not able to get the desired results from there. Maybe i was doing something wrong.

I tried a long method and it worked as i expected. Below is the script:

Temp_Table1:
Load
Account Name,
Account Internal Name,
Account Internal Name as 'Name',
FROM [lib://data/Source.xlsx]
(ooxml, embedded labels, table is Sheet1);


Temp_Table2:
Load
Name as 'Account Name',
Category
FROM [lib://data/Source.xlsx]
(ooxml, embedded labels, table is Sheet2);

No Concatenate
Temp_Table3:
Load
Name,
Category
FROM [lib://data/Source.xlsx]
(ooxml, embedded labels, table is Sheet2);


Main Table:

Load
Account Name,
Account Internal Name,
Category

Resident Temp_Table1;
Drop Temp_Table1;