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: 
Ethel
Creator III
Creator III

join tables in data loader

Hello,

could you please help me with a problem.

I have two data sets that need to be loaded. 

in SQL it will look like this:

Select 

t1.A,

t1.B+t1.C,

T2.E

from t1

left join t2

on t1.A=t2.A

In Qlik Sense  when I do this:

T1:

load

A,

B+C,

T2:

Load

A,

E

I'm getting correct result, but extra syntactic keys. When I'm trying to add left join, I'm getting the wrong number for B+C. 

What am I doing wrong?

Thanks a lot in advance!

 

Labels (5)
1 Solution

Accepted Solutions
Ethel
Creator III
Creator III
Author

I found a solution...My problem was I didn't add distinct when I was loading t2. 

View solution in original post

8 Replies
PrashantSangle

Temp:

Load A, B , C from Table1;

Left Join

Load A,E from Table2;

Noconcatenate

Final:

Load A,B+C,E Resident Temp;

Drop Table Temp;

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sidhiq91
Specialist II
Specialist II

@Ethel  Please use the below script in you load Editor:

NoConcatenate
Table1:
Load * Inline [
A, B, C
1,4,7
2,5,8
3,6,9
];

Left join (Table1)
Load * Inline [
A,E
1,Si
2,Mu
4,Ne
];


NoConcatenate
Table:
Load A,
B+C as Total,
E
Resident Table1;
Drop table Table1;

Exit Script;

If this resolves your issue, please like and accept it as a solution.

Ethel
Creator III
Creator III
Author

Thank you so much! No unfortunately I'm still getting wrong number. But if I do one load after another, result is correct. What type of join qlik do automatically? 

Ethel
Creator III
Creator III
Author

Thank you so much! Unfortunately, I'm still getting wrong number. But if I do one load after another, result is correct. What type of join qlik do automatically? I tried even outer join, still wrong number...but If i do one load after another, result is correct....

Selvapriya_Thevar
Contributor II
Contributor II

@Ethel  What type of join qlik do automatically? - By default, Qlik performs an outer join.

Ethel
Creator III
Creator III
Author

I tried outer join, but I also got the wrong result.

PrashantSangle

Be default qlik never do any join 

If your all fields are same between 2 tables then it will do concatenation

If you have few fields same between 2 tables the ln qlik create a synthetic key which is combination of all common fields between 2 tables.

Regards,

Prashant Sangle 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Ethel
Creator III
Creator III
Author

I found a solution...My problem was I didn't add distinct when I was loading t2.