Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
swathidumpala
Contributor
Contributor

joining 2 tables

Hi I am very new to Qlik sense.

I am building a Qlik excel report.

I need to join 2 tables as below.

 

TableA:
LOAD
Month,
CustomerId,
BranchKey,
active
FROM [lib://XXXXXXXXXXXXXXX]
(qvd) where Month='201905';

TableB:
LOAD
MONTH,
BSB,
DESC

FROM [lib:/YYYYYYYYYYYYYYYYYY]
(qvd);

I need to join the above 2 tables and get the distinct BranchKey from Table A, corresponding  DESC from Table B

and need to join on TableA.BranchKey =TableB.BSB.

Request you to help me on how to achieve it.

1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

We can associate these two tables by renaming one of the fields to match the other, or join if the fields are the same. A warning Qlik Sense is case sensitive, so you may decide to rename BranchKey to BSB or vice verse using as in the load statement.

TableA:
LOAD
Month,
CustomerId,
BranchKey,
active
FROM [lib://XXXXXXXXXXXXXXX]
(qvd) where Month='201905';

//TableB:

Left Join(TableA):
LOAD
MONTH as Month,
BSB as BranchKey,
DESC

FROM [lib:/YYYYYYYYYYYYYYYYYY]
(qvd);

View solution in original post

7 Replies
Lisa_P
Employee
Employee

We can associate these two tables by renaming one of the fields to match the other, or join if the fields are the same. A warning Qlik Sense is case sensitive, so you may decide to rename BranchKey to BSB or vice verse using as in the load statement.

TableA:
LOAD
Month,
CustomerId,
BranchKey,
active
FROM [lib://XXXXXXXXXXXXXXX]
(qvd) where Month='201905';

//TableB:

Left Join(TableA):
LOAD
MONTH as Month,
BSB as BranchKey,
DESC

FROM [lib:/YYYYYYYYYYYYYYYYYY]
(qvd);

swathidumpala
Contributor
Contributor
Author

Thanks Lisa.

It worked except Left Join(TableA):  I had remove the colon to made it work.

Thanks a lot!

Lisa_P
Employee
Employee

Yes,  sorry , my mistake

swathidumpala
Contributor
Contributor
Author

Hi Lisa,

As an extension to it , I need to get the customer count from Table C , where C.customer_id=A.customer_id

group by A.Branch_key

So the output should be

     1                                 2                              3

A.Branch_key         B.DESC            C.Customer_Count

 

We have achieved till 2.

I am struck to go ahead.

Please advice!

 

 

Lisa_P
Employee
Employee

If this customer_id is a key field, are you expecting different values in each table ?

swathidumpala
Contributor
Contributor
Author

Yes Lisa.

swathidumpala
Contributor
Contributor
Author

sorry , actually they are different

ciskey from first table and

customer_id from second table.